Design Patterns

Get Started. It's Free
or sign up with your email address
Design Patterns by Mind Map: Design Patterns

1. Categories

1.1. Creational

1.2. Structural

1.3. Behavioral

2. Creational

2.1. Abstract Factory

2.1.1. Provide an interface for creating families of related or dependent objects without specifying their concrete classes.

2.2. Factory Method

2.2.1. Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

2.3. Builder

2.3.1. Separate the construction of a complex object from its representation so that the same construction process can create different representations.

2.4. Lazy Initialization

2.5. Object Pool

2.5.1. used to manage the object caching

2.6. Prototype

2.6.1. Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.

2.7. Singleton

2.7.1. Highlander

2.7.1.1. One instance only

2.7.2. Borg

2.7.2.1. Multiple instances sharing state

2.7.3. Multiton

2.7.3.1. One instance per key

2.8. Utility

3. Structural

3.1. Adapter

3.1.1. Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.

3.2. Bridge

3.2.1. Decouple an abstraction from its implementation so that the two can vary independently.

3.3. Composite

3.3.1. Compose objects into tree structures to represent whole-part hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.

3.4. Decorator

3.4.1. Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.

3.5. Facade

3.5.1. Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.

3.5.1.1. Simple Interface

3.5.1.2. Hide complexity

3.6. Flyweight

3.6.1. Use sharing to support large numbers of fine-grained objects efficiently.

3.7. Proxy

3.7.1. Provide a surrogate or placeholder for another object to control access to it.

4. Behavioral

4.1. Chain Of Responsibility

4.1.1. Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.

4.2. Command

4.2.1. Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.

4.3. Interpreter

4.3.1. Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.

4.4. Iterator

4.4.1. Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.

4.5. Mediator

4.5.1. Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.

4.6. Memento

4.6.1. Without violating encapsulation, capture and externalize an object's internal state so that the object can be returned to this state later.

4.7. Observer

4.7.1. Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

4.8. State

4.8.1. Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.

4.9. Strategy

4.9.1. Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from the clients that use it.

4.10. Specification

4.11. Template Method

4.11.1. Define the skeleton of an algorithm in an operation, deferring some steps to client subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.

4.11.1.1. Concrete Methods

4.11.1.2. Organizing Methods

4.12. Visitor

4.12.1. Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.

4.12.1.1. Single-Serving Visitor

4.12.1.2. Hierarchical Visitor

4.13. Null Object

4.13.1. The intent of a Null Object is to encapsulate the absence of an object by providing a substitutable alternative that offers suitable default do nothing behavior.

4.14. Sentinel