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: Adapter

Type: Structural

Use when you want to:

Make interfaces compatable

Variants

From Wikipedia:

In software engineering, the adapter pattern is a software design pattern that allows the interface of an existing class to be used as another interface. It is often used to make...

1 minute
Contact me

Name: Bridge

Type: Structural

Use when you want to:

Handle orthogonal ("Changing A does not change B") concerns separately. Think colors, shapes.

Variants

From Wikipedia:

The bridge pattern is a design pattern used in software engineering that is meant to "decouple an abstraction fro...

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

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