Examples of generative design patterns

  • Abstract factory - A class that is an interface for creating other classes.
  • Builder - A class that is an interface for creating a complex object.
  • Factory method - Delegates the creation of objects to the heirs of the parent class. This allows you to use in the program code not specific classes, but to manipulate abstract objects at a higher level.
  • Prototype - Defines the interface for creating an object by cloning another object instead of creating it through a constructor.
  • Singleton - A class that can have only one instance.

Read also:


Comments

Popular posts from this blog

Methods for reading XML in Java

XML, well-formed XML and valid XML

ArrayList and LinkedList in Java, memory usage and speed