Modeling/DesignPattern

Categorizing Design Pattern

데먕 2019. 9. 29. 17:32

1. Overview

Design patterns are solutions to software design problems you find again and again in real-world application development. Patterns are about reusable designs and interactions of objects. The 23 Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized into three groups: Creational, Structural, and Behavioral

2. Description

2.1 Creational Pattern

These design patterns provide ways to create objects while hiding the creation logic, instead of instantiating objects directly using the new operator. This gives the program more flexibility in deciding which objects need to be created for a given use case.

name Description
Abstract Factory Creates an instance of several families of classes
Builder Separates object construction from its representation
Factory method Creates an instance of several derived classes
Prototype A fully initialized instance to be copied or cloned
Singleton A class of which only a single instance can exist

2.2 Structural Pattern

These design patterns deal with class and object composition. The concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionality.

Name Description
Adapter Match interfaces of different classes
Bridge Separate an object's interface from its implementation
Composite A tree structure of simple and composite objects
Decorator Add responsibilities to objects dynamically
Facade A single class that represents an entire subsystem
Flyweight A fine-grained instance used for efficient sharing
Proxy  An object representing another object

2.3 Behavioral Pattern

These design patterns are specifically concerned with communication between objects.

Name Description
Chain of Resp. A way of passing a request between a chain of objects
Command Encapsulate a command request as an object
Interpreter A way to include language elements in a program
Iterator Sequentially access the elements of a collection
Mediator Defines simplified communication between classes
Mememto Capture an restore an object's internal state
Observer A way of notifying a change to a number of classes
State Alter an object's behavior when its state changes
Strategy Encapsulates an algorithm to a subclass
Template Method Defer the exact steps of an algorithm to a subclass
Visitor  Defines a new operation to a class without change

3. References

https://www.slideshare.net/ircmaxell/beyond-design-patterns-phpnw14

https://www.quora.com/What-is-the-difference-between-Creational-Structural-and-Behavioral-Patterns