设计模式gof
Gangs of Four Design Patterns is the collection of 23 design patterns from the book “Design Patterns: Elements of Reusable Object-Oriented Software”.
四种设计模式的帮派是《设计模式:可重用的面向对象软件的元素》一书中的23种设计模式的集合。
This book was first published in 1994 and it’s one of the most popular books to learn design patterns. The book was authored by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. It got nicknamed as Gangs of Four design patterns because of four authors. Furthermore, it got a shorter name as “GoF Design Patterns”.
这本书于1994年首次出版,是学习设计模式的最受欢迎的书籍之一。 该书由Erich Gamma,Richard Helm,Ralph Johnson和John Vlissides撰写。 由于四位作者,它被昵称为“四个设计模式的帮派”。 此外,它的简称为“ GoF设计模式”。
GoF设计模式类型 (GoF Design Pattern Types)
GoF Design Patterns are divided into three categories:
GoF设计模式分为三类:
- Creational: The design patterns that deal with the creation of an object. Creational :涉及对象创建的设计模式。
- Structural: The design patterns in this category deals with the class structure such as Inheritance and Composition. 结构 :此类别中的设计模式涉及类结构,例如继承和组成。
- Behavioral: This type of design patterns provide solution for the better interaction between objects, how to provide lose coupling, and flexibility to extend easily in future. 行为的 :这种类型的设计模式提供了解决方案,以实现对象之间更好的交互,如何提供丢失耦合以及将来轻松扩展的灵活性。
创新设计模式 (Creational Design Patterns)
There are 5 design patterns in the creational design patterns category.
创新设计模式类别中有5个设计模式。
Pattern Name | Description |
---|---|
Singleton | The singleton pattern restricts the initialization of a class to ensure that only one instance of the class can be created. |