1.MVC
(1)Model: The application object;
(2)View: The screen presentation of the model;
(3)Controller: the way the user interface reacts the user input.
2.View and Model: decouple views and models
Establish a subscribe/notify protocol between views and models.
Subscribe: Update or create views without rewriting models.
Notify: Changing models will notify views that depend on them.
3.View and View: CompositeView: implemented as a complex view containing nested button views.
4.View and Controller: Encapsulate the response mechanism to user input in a Controller object.
(1)There is a hierarcy of controllers, making it easy to create a new controller a new controller as a variation on an existing one.
(2)A view uses an instance of a Controller subclass to implement a particular response strategy.
(3)To implement a different strategy, simply replace the instance with a different kind of controller.
(3)To change a view's controller at run-time.
5.Observer:
A design to applicable to a more general problem: decoupling objects so that changes to one can affect any number of others without requiring the changed object to know details of the others.
6.Composite:
A design to let programmers create a class hierarchy in which some subclasses define primitive objects and other classes define composite objects that assemble the primitives into more complex objects.
7.Strategy:
A Strategy is an object that represents an algorithm. It's useful when you want to replace the algorithm either statically or dynamically, when you have a lot of variants of the algorithm, or when the algorithm has complex data structures that you want to encapsulate.
9.Main relationships and other relationships in MVC
(1)Main relationships: Observer, Composite and Strategy.
(2)Other relationships: Factory and Decorator.
分享到:
相关推荐
书名: 设计模式可复用面向对象软件的基础 英文原书名: Design Patterns:Elements of Reusable Object-Oriented software 作者: Erich Gamma 等 译者: 李英军 马晓星 蔡敏 刘建中 书号: 7-111-07575-7 页码: 254 定价...
本书结合设计实例从面向对象的设计中精选出23个设计模式,总结了面向对象设计中最有价值的经验,并且用简洁可复用的形式表达出来。本书分类描述了一组设计良好、表达清楚的软件设计模式,这些模式在实用环境下特别...
设计模式可复用面向对象软件的基础 23中设计模式 源码实现
设计模式:可复用面向对象软件的基础 中文高清版。此书是一本必看的设计模式书籍,书中实例采用c++实现。
设计模式:可复用面向对象软件的基础(中文)Design Patterns:Elements of Reusable Object-Oriented software
设计模式-可复用面向对象软件的基础 中文版 设计模式-可复用面向对象软件的基础 英文版 设计模式-可复用面向对象软件的基础 source code 设计模式(C++)源代码 一雨田
书名: 设计模式可复用面向对象软件的基础 英文原书名: Design Patterns:Elements of Reusable Object-Oriented software 作者: Erich Gamma 等 译者: 李英军 马晓星 蔡敏 刘建中 本书设计实例从面向对象的设计中...
设计模式 可复用面向对象软件的基础 包含中文英高清版。
书名: 设计模式可复用面向对象软件的基础 英文原书名: Design Patterns:Elements of Reusable Object-Oriented software 作者: Erich Gamma 等 译者: 李英军 马晓星 蔡敏 刘建中 书号: 7-111-07575-7 页码: 254 定价...
设计模式:可复用面向对象软件的基础 pdf英文版 Design Patterns Elements of Reusable Object-Oriented Software
此为《设计模式:可复用面向对象软件的基础》一书的英文版(PDF格式),考虑到不是每个人都需要看英文原版,将英文单独上传,有需要中文的请移步下载! 此书国外大师Erich Gamma、Richard Helm等编写。 《Design ...
设计模式 可复用面向对象软件的基础 Design Patterns Elements of Resuable Object-Oriented Software 中文版 英文版 随书CD百度推广助手
这本书结合设计实作例从面向对象的设计中精选出23个设计模式,总结了面向对象设计中最有价值的经验,并且用简洁可复用的形式表达出来。书中分类描述了一组设计良好、表达清楚的软件设计模式,这些模式在实用环境下...
书名: 设计模式可复用面向对象软件的基础 英文原书名: Design Patterns:Elements of Reusable Object-Oriented software 作者: Erich Gamma 等 译者: 李英军 马晓星 蔡敏 刘建中 本书设计实例从面向对象的设计中精选...
书名: 设计模式可复用面向对象软件的基础 英文原书名: Design Patterns:Elements of Reusable Object-Oriented software 作者: Erich Gamma 等 译者: 李英军 马晓星 蔡敏 刘建中 本书设计实例从面向对象的设计中精选...
书名: 设计模式可复用面向对象软件的基础 英文原书名: Design Patterns:Elements of Reusable Object-Oriented software 作者: Erich Gamma 等 译者: 李英军 马晓星 蔡敏 刘建中 书号: 7-111-07575-7...