Added alias names for GOF patterns #267

This commit is contained in:
Ilkka Seppala 2015-11-04 21:13:32 +02:00
parent fe63c9cec4
commit c02e65fa3a
12 changed files with 24 additions and 0 deletions

View File

@ -9,6 +9,8 @@ tags:
- Gang Of Four - Gang Of Four
--- ---
**Also known as:** Kit
**Intent:** Provide an interface for creating families of related or dependent **Intent:** Provide an interface for creating families of related or dependent
objects without specifying their concrete classes. objects without specifying their concrete classes.

View File

@ -9,6 +9,8 @@ tags:
- Gang Of Four - Gang Of Four
--- ---
**Also known as:** Wrapper
**Intent:** Convert the interface of a class into another interface the clients **Intent:** Convert the interface of a class into another interface the clients
expect. Adapter lets classes work together that couldn't otherwise because of expect. Adapter lets classes work together that couldn't otherwise because of
incompatible interfaces. incompatible interfaces.

View File

@ -9,6 +9,8 @@ tags:
- Gang Of Four - Gang Of Four
--- ---
**Also known as:** Handle/Body
**Intent:** Decouple an abstraction from its implementation so that the two can **Intent:** Decouple an abstraction from its implementation so that the two can
vary independently. vary independently.

View File

@ -9,6 +9,8 @@ tags:
- Gang Of Four - Gang Of Four
--- ---
**Also known as:** Action, Transaction
**Intent:** Encapsulate a request as an object, thereby letting you **Intent:** Encapsulate a request as an object, thereby letting you
parameterize clients with different requests, queue or log requests, and parameterize clients with different requests, queue or log requests, and
support undoable operations. support undoable operations.

View File

@ -9,6 +9,8 @@ tags:
- Gang Of Four - Gang Of Four
--- ---
**Also known as:** Wrapper
**Intent:** Attach additional responsibilities to an object dynamically. **Intent:** Attach additional responsibilities to an object dynamically.
Decorators provide a flexible alternative to subclassing for extending Decorators provide a flexible alternative to subclassing for extending
functionality. functionality.

View File

@ -10,6 +10,8 @@ tags:
- Gang Of Four - Gang Of Four
--- ---
**Also known as:** Virtual Constructor
**Intent:** Define an interface for creating an object, but let subclasses **Intent:** Define an interface for creating an object, but let subclasses
decide which class to instantiate. Factory Method lets a class defer decide which class to instantiate. Factory Method lets a class defer
instantiation to subclasses. instantiation to subclasses.

View File

@ -10,6 +10,8 @@ tags:
- Gang Of Four - Gang Of Four
--- ---
**Also known as:** Cursor
**Intent:** Provide a way to access the elements of an aggregate object **Intent:** Provide a way to access the elements of an aggregate object
sequentially without exposing its underlying representation. sequentially without exposing its underlying representation.

View File

@ -9,6 +9,8 @@ tags:
- Gang Of Four - Gang Of Four
--- ---
**Also known as:** Token
**Intent:** Without violating encapsulation, capture and externalize an **Intent:** Without violating encapsulation, capture and externalize an
object's internal state so that the object can be restored to this state later. object's internal state so that the object can be restored to this state later.

View File

@ -10,6 +10,8 @@ tags:
- Gang Of Four - Gang Of Four
--- ---
**Also known as:** Dependents, Publish-Subscribe
**Intent:** Define a one-to-many dependency between objects so that when one **Intent:** Define a one-to-many dependency between objects so that when one
object changes state, all its dependents are notified and updated object changes state, all its dependents are notified and updated
automatically. automatically.

View File

@ -10,6 +10,8 @@ tags:
- Difficulty-Intermediate - Difficulty-Intermediate
--- ---
**Also known as:** Surrogate
**Intent:** Provide a surrogate or placeholder for another object to control **Intent:** Provide a surrogate or placeholder for another object to control
access to it. access to it.

View File

@ -10,6 +10,8 @@ tags:
- Gang Of Four - Gang Of Four
--- ---
**Also known as:** Objects for States
**Intent:** Allow an object to alter its behavior when its internal state **Intent:** Allow an object to alter its behavior when its internal state
changes. The object will appear to change its class. changes. The object will appear to change its class.

View File

@ -10,6 +10,8 @@ tags:
- Gang Of Four - Gang Of Four
--- ---
**Also known as:** Policy
**Intent:** Define a family of algorithms, encapsulate each one, and make them **Intent:** Define a family of algorithms, encapsulate each one, and make them
interchangeable. Strategy lets the algorithm vary independently from clients interchangeable. Strategy lets the algorithm vary independently from clients
that use it. that use it.