Strategy Pattern

1. Usage Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from the clients that use it. Capture the abstraction in […]

Read More

Visitor Pattern

1. Usage Adds new operations to existing object structure without modifying that structure. Separates an algorithm from an object structure on which it operates. Example: An example would be a […]

Read More

Command pattern

1. Usage Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations. The purpose of the Command pattern […]

Read More

Iterator pattern

1. Usage Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation. makes possible to decouple collection classes and algorithms. Promote to “full […]

Read More

Interpreter pattern

1. Usage Specialized database query languages such as SQL,RegExp. Specialized computer languages which are often used to describe communication protocols. Most general-purpose computer languages actually incorporate several specialized languages.(lua script […]

Read More

Mediator pattern

1. Usage In software engineering, the mediator pattern defines an object that encapsulates how a set of objects interact. This pattern is considered to be a behavioral pattern due to […]

Read More

Memento pattern

1. Usage Saves inner state of object in order to restore it in future. Usually implemented in Undo/Redo of Editors sometimes with Command Pattern. Memento in C++ implemented as Friend […]

Read More

Chain of responsibility pattern

1. Usage 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 […]

Read More

Decorator

1. Usage Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality. [GoF, p175] Client-specified embellishment of a core object by recursively wrapping […]

Read More

Facade

1. Usage When sub-system very complex and has many subsystems it make sense to unify access to it by providing single interface called facade. Facade isolate subsystems from direct calls […]

Read More