Design Patterns - Elements of Reusable Object-Oriented Software
2017-05-23 08:29
676 查看
《Design Patterns - Elements of Reusable Object-Oriented Software》
中文译名:设计模式 - 可复用的面向对象软件元素
1994 年,由 Erich Gamma、Richard Helm、Ralph Johnson 和 John Vlissides 四人合著出版;四位作者合称 GOF(四人帮,全拼 Gang of Four)。
他们所提出的设计模式主要是基于以下的面向对象设计原则。
对接口编程而不是对实现编程。
优先使用对象组合而不是继承。
设计模式类型:总共有 23 种设计模式。
这些模式可以分为三大类:
创建型模式(Creational Patterns、
结构型模式(Structural Patterns)
行为型模式(Behavioral Patterns)
设计模式的6大原则:
1、开闭原则(Open Close Principle)
开闭原则的意思是:对扩展开放,对修改关闭。
2、里氏代换原则(Liskov Substitution Principle)
里氏代换原则是面向对象设计的基本原则之一。 里氏代换原则中说,任何基类可以出现的地方,子类一定可以出现。里氏代换原则是对开闭原则的补充。实现开闭原则的关键步骤就是抽象化,而基类与子类的继承关系就是抽象化的具体实现,所以里氏代换原则是对实现抽象化的具体步骤的规范。
3、依赖倒转原则(Dependence Inversion Principle)
这个原则是开闭原则的基础,具体内容:针对接口编程,依赖于抽象而不依赖于具体。
4、接口隔离原则(Interface Segregation Principle)
这个原则的意思是:使用多个隔离的接口,比使用单个接口要好。它还有另外一个意思是:降低类之间的耦合度。由此可见,其实设计模式就是从大型软件架构出发、便于升级和维护的软件设计思想,它强调降低依赖,降低耦合。
5、迪米特法则,又称最少知道原则(Demeter Principle)
最少知道原则是指:一个实体应当尽量少地与其他实体之间发生相互作用,使得系统功能模块相对独立。
6、合成复用原则(Composite Reuse Principle)
合成复用原则是指:尽量使用合成/聚合的方式,而不是使用继承。
中文译名:设计模式 - 可复用的面向对象软件元素
1994 年,由 Erich Gamma、Richard Helm、Ralph Johnson 和 John Vlissides 四人合著出版;四位作者合称 GOF(四人帮,全拼 Gang of Four)。
他们所提出的设计模式主要是基于以下的面向对象设计原则。
对接口编程而不是对实现编程。
优先使用对象组合而不是继承。
设计模式类型:总共有 23 种设计模式。
这些模式可以分为三大类:
创建型模式(Creational Patterns、
结构型模式(Structural Patterns)
行为型模式(Behavioral Patterns)
设计模式的6大原则:
1、开闭原则(Open Close Principle)
开闭原则的意思是:对扩展开放,对修改关闭。
2、里氏代换原则(Liskov Substitution Principle)
里氏代换原则是面向对象设计的基本原则之一。 里氏代换原则中说,任何基类可以出现的地方,子类一定可以出现。里氏代换原则是对开闭原则的补充。实现开闭原则的关键步骤就是抽象化,而基类与子类的继承关系就是抽象化的具体实现,所以里氏代换原则是对实现抽象化的具体步骤的规范。
3、依赖倒转原则(Dependence Inversion Principle)
这个原则是开闭原则的基础,具体内容:针对接口编程,依赖于抽象而不依赖于具体。
4、接口隔离原则(Interface Segregation Principle)
这个原则的意思是:使用多个隔离的接口,比使用单个接口要好。它还有另外一个意思是:降低类之间的耦合度。由此可见,其实设计模式就是从大型软件架构出发、便于升级和维护的软件设计思想,它强调降低依赖,降低耦合。
5、迪米特法则,又称最少知道原则(Demeter Principle)
最少知道原则是指:一个实体应当尽量少地与其他实体之间发生相互作用,使得系统功能模块相对独立。
6、合成复用原则(Composite Reuse Principle)
合成复用原则是指:尽量使用合成/聚合的方式,而不是使用继承。
相关文章推荐
- Design Patterns - Elements of Reusable Object-Oriented Software 设计模式-可复用的面向对象软件元素。【笔记】
- Design Patterns Elements of Reusable Object-Oriented Software(一)Introduction(介绍)
- Patterns in Java: A Catalog of Reusable Design Patterns Illustrated with UML, 2nd Edition, Volume 1
- Python Design Patterns I(Chapter 8 of Python 3 Object Oriented Programming)
- Python Design Patterns II(Chapter 9 of Python 3 Object Oriented Programming)
- Design Patterns in Object-Oriented Frameworks ( By Savitha Srinivasan IBM)
- Massive Collection Of Design Patterns, Frameworks, Components, And Language Features For Delphi
- [导入]A Taste of AOP from Solving Problems with OOP and Design Patterns (Part I)
- Non-Software Examples of Software Design Patterns
- Strategy(Chapter 19 of Pro Objective-C Design Patterns for iOS)
- HTML5 JSON ( tuple => Object => JSON => Object=> Elements_of_tuple )
- Adapter(Chapter 8 of Pro Objective-C Design Patterns for iOS)
- The Design of Sites: Patterns, Principles, and Processes for Crafting a Customer-Centered Web Experience
- Façade(Chapter 10 of Pro Objective-C Design Patterns for iOS)
- Observer(Chapter 12 of Pro Objective-C Design Patterns for iOS)
- [导入]A Taste of AOP from Solving Problems with OOP and Design Patterns (Part I)
- Design Patterns -- Chain of Responsibility (CoR)
- Foundations of Object-Oriented Programming Using .NET 2.0 Patterns
- The Design of Sites: Patterns, Principles, and Processes for Crafting a Customer-Centered Web Experi
- Prototype(Chapter 3 of Pro Objective-C Design Patterns for iOS)