1 minute
Contact me

Name: Template

Type: Behavioural

Use when you want to:

define a skeleton of how a certain algorithm could be performed, and defer the implementation of those steps to the children classes

From Wikipedia:

In software engineering, the template method pattern is a behavioral design pattern...

1 minute
Contact me

Name: Command

Name: State

Type: Behavioural

Use when you want to:

Change the behavior of a class when the state changes.

From Wikipedia:

The state pattern is a behavioral software design pattern that implements a state machine in an object-oriented way. With the state pattern, a state...

1 minute
Contact me

Name: Strategy

Type: Behavioural

Use when you want to:

Switch the algorithm or strategy based upon the situation.

From Wikipedia:

In computer programming, the strategy pattern (also known as the policy pattern) is a behavioural software design pattern that enables an algorithm's behavior...

1 minute
Contact me

Name: Visitor

Type: Behavioural

Use when you want to:

Add operations to an object without modifying the object.

From Wikipedia:

In object-oriented programming and software engineering, the visitor design pattern is a way of separating an algorithm from an object structure on which it ope...

1 minute
Contact me

Name: Observer

(Otherwise known as "pub-sub")

Type: Behavioural

Use when you want to:

Define a dependency between objects so that whenever an object changes its state, all its dependents are notified.

From Wikipedia:

The observer pattern is a software design pattern in which an object,...

0 minutes
Contact me

Name: Mediator

Type: Behavioural

Use when you want to:

Mediate two objects (colleagues) and how they communicate without the colleagues knowing about eachothers implementations.

From Wikipedia:

In software engineering, the mediator pattern defines an object that encapsulates how a set of...

1 minute
Contact me

Name: Memento

Type: Behavioural

Use when you want to:

Add undo functionality.

From Wikipedia:

The memento pattern is a software design pattern that provides the ability to restore an object to its previous state (undo via rollback).

Real World Example:

Take the example of a text...

1 minute
Contact me

Name: Iterator

Type: Behavioural

Use when you want to:

Access the elements of an object without exposing the underlying presentation.

From Wikipedia:

In object-oriented programming, the iterator pattern is a design pattern in which an iterator is used to traverse a container and access t...

1 minute
Contact me

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...