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