您的位置:学习中国 常用工具 电子书籍 正文
原作者:不详 添加时间:2007-07-12 原文发表:2007-07-12 人气:40 来源:互联网

本文章共7841字,分5页,当前第3页,快速翻页:
 
-----------------------------------------------------------------------------------------------------------------------------------------------

本文提示:《实用指南设计面向对象的软件(3)》是本站编辑们为广大网友精选的实用文章,本文阐述了关于文章的相关理论,相对来说专业性强,但是本文只是针对于某个问题提出的见解与论述,未必能辐射到相关问题的方方面面,所以本文处理问题的方法仅仅为您提供一些参考。更多问题请查阅学习中国网其他栏目哦.

-----------------------------------------------------------------------------------------------------------------------------------------------

www.xuexi86.com
3. The solution describes the elements that make up the design,their relationships,responsibilities,and collaborations.The solution doesn't describe a particular concrete design or implementation,because a pattern is like a template that can be applied in many different situations. Instead, the pattern provides an abstract description of a design problem and how a general arrangement of elements (classes and objects in our case) solves it.
4. The consequences are the results and trade-offs of applying the pattern. Though consequences are often unvoiced when we describe design decisions,they are critical for evaluating design alternatives and for understanding the costs and benefits of applying the pattern. The consequences for software often concern space and time trade-offs. They may address language and implementation issues as well. Since reuse is often a factor in object-oriented design,the consequences of a pattern include its impact on a system's flexibility,extensibility,or portability. Listing these consequences explicitly helps you understand and evaluate them.
Point of view affects one's interpretation of what is and isn't a pattern. One person's pattern can be another person's primitive building block. For this book we have concentrated on patterns at a certain level of abstraction. Design patterns are not about designs such as linked lists and hash tables that can be encoded in classes and reused as is. Nor are they complex,domain-specific designs for an entire application or subsystem. The design patterns in this book are descriptions of communicating objects and classes that are customized to solve a general design problem in a particular context.
A design pattern names,abstracts,and identifies the key aspects of a common design structure that make it useful for creating a reusable object-oriented design. The design pattern identifies the participating classes and instances,their roles and collaborations,and the distribution of responsibilities. Each design pattern focuses on a particular object-oriented design problem or issue. It describes when it applies,whether it can be applied in view of other design constraints,and the consequences and trade-offs of its use. Since we must eventually implement our designs,a design pattern also provides sample C++ and (sometimes) Smalltalk code to illustrate an implementation.
Although design patterns describe object-oriented designs,they are based on practical solutions that have been implemented in mainstream object-oriented programming languages like Smalltalk and C++ rather than procedural languages (Pascal,C,Ada) or more dynamic object-oriented languages (CLOS,Dylan,Self). We chose Smalltalk and C++ for pragmatic reasons: Our day-to-day experience has been in these languages,and they are increasingly popular.
The choice of programming language is important because it influences one's point of view. Our patterns assume Smalltalk/C++-level language features, and that choice determines what can and cannot be implemented easily. If we assumed procedural languages,we might have included design patterns called "Inheritance," "Encapsulation," and "Polymorphism." Similarly,some of our patterns are supported directly by the less common object-oriented languages. CLOS has multi-methods,for example,which lessen the need for a pattern such as Visitor . In fact,there are enough differences between Smalltalk and C++ to mean that some patterns can be expressed more easily in one language than the other.
 
本文章更多内容<<上一页 - 1 - 2 - 3 - 4 - 5 - 下一页>>
本页地址
收藏到:[收藏夹] [百度搜藏] [新浪ViVi] [POCO网摘] [ 和讯网摘] [好哦网摘] [Google书签]
               
[搜狐网摘] [365Key网摘] [天极网摘] [我摘] [博采网摘] [igooi网摘]
相关文章

电脑维修与优化教程
2006年度巨献之电脑知识与技巧大合集
很全面的菜鸟入门教材
DOS高手速成
ghost简易说明书
到了异界就是超人(手机版)
篡命师(PC版)
转世灭神(PC版)
异界侠客行(PC版)
我的岳父是吕布(PC版)
自学(网站制作,FLASH,photoshop,3D)者
电脑终极技巧

相关评论


本文章所属分类:首页 常用工具 电子书籍   电子书籍