Java Creational Design Patterns

5 types of creational design patterns:

  1. Factory Design Patterns: Purpose: Create Objects, Keep Object Creation Centralized
  2. Abstract Factory Design Patterns
  3. Singleton Design Pattern: Limit instantiation  of a clas to only one instance
  4. Prototype Design Patterns: Object creation based on Prototype Object Instance; Simpler Object Creation than Factory.
  5. Builder Design Patterns: Object Creation, Complex Object Creation, Keep Complex Object Creation separate from it’s representation.

For Factory: Simple Factory, Factory Method, Abstract Factory

Factory Method: Construction separated from implementation. Objects can be created without defining the exact class of object to be created.

Abstract Factory: One layer above Factory Method. Super Factory. Creates other Factories to create objects.

Builder Design Patterns: Helps to create complex objects. Uses construction methods/processes that can be used to create different representations of Objects. Step by step construction.

Ref: https://www.geeksforgeeks.org/creational-design-pattern/

Builder Pattern: Ref: Wikipedia

Factory Method Design Pattern: (Wikipedia)

Abstract Factory Design Pattern: (Wikipedia)