Name: Command
Type: Behavioural
Use when you want to:
Encapsulate actions in objects. The key idea behind this pattern is to provide the means to decouple client from receiver.
From Wikipedia:
In object-oriented programming, the command pattern is a behavioral design pattern in which an...
Name: Chain of Responsibility
Type: Behavioural
Use when you want to:
Build a chain of objects. A request enters from one end and keeps moving along the chain until it finds a suitable handler.
From Wikipedia:
In object-oriented design, the chain-of-responsibility pattern is a design pa...
Name: Proxy
Type: Structural
Use when you want to:
Represent the functionality of anoter class.
From Wikipedia:
A proxy, in its most general form, is a class functioning as an interface to something else. A proxy is a wrapper or agent object that is being called by the client to access t...
Name: Flyweight
Type: Structural
Use when you want to:
Avoid recomputing data that has previously been computed. (memoization).
From Wikipedia:
In computer programming, flyweight is a software design pattern. A flyweight is an object that minimizes memory use by sharing as much data as p...
Name: Facade
Type: Structural
Use when you want to:
Provide a simplified interface to a complex subsystem.
From Wikipedia:
A facade is an object that provides a simplified interface to a larger body of code, such as a class library.
Real World Example:
What do you do turn a compu...
Name: Decorator
Type: Structural
Use when you want to:
Change the behaviour of one object dynamically and transparently, without changing the class of objects.
From Wikipedia:
In object-oriented programming, the decorator pattern is a design pattern that allows behavior to be added to an...
Name: Composite
Type: Structural
Use when you want to:
Selectively treat a group of objects that are part of a hierarchy as "the same" when they are in fact different.
From Wikipedia:
In software engineering, the composite pattern is a partitioning design pattern. The composite pattern...
Name: Prototype
Type: Creational
Use when you want to:
Clone an object rather than create one
From Wikipedia:
The prototype pattern is a creational design pattern in software development. It is used when the type of objects to create is determined by a prototypical instance, which is clo...