0 minutes
Contact me

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

1 minute
Contact me

Name: Singleton

Type: Creational

Use when you want to:

  • To manage a shared resource.
  • To read global state.

A quick note:

There aren't a ton of reasons to ever use a singleton. If however you want global information to flow into the singleton and not back into the app again, then it is a...

1 minute
Contact me

Name: Builder

Type: Creational

Use when you want to:

  • do lots of things to build an object
  • design classes whose constructors or static factories would have more than a handful of parameters.

From Wikipedia:

The builder pattern is an object creation software design pattern with the inten...

4 minutes
Contact me

Name: Factory

Type: Creational

Use when you want to:

  • Generate an instance for a client without exposing any instantiation logic to the client
  • Hide the dependencies of class instantiation from clients

Variants

Simple

From Wikipedia:

In object-oriented programming (OOP), a factory is...