4.1. Creational Patterns

Creational patterns support the creation of objects in a system. Creational patterns allow objects to be created in a system without having to identify a specific class type in the code, so you do not have to write large, complex code to instantiate an object. It does this by having the subclass of the class create the objects. However, this can limit the type or number of objects that can be created within a system.

The following Creational patterns are described:

  • Abstract Factory

  • Builder

  • Factory Method

  • Prototype

  • Singleton

Abstract Factory Pattern

This pattern provides an interface for creating families of related or dependent objects without specifying their concrete classes.

Given a set of related abstract classes, the ...

Get Sun Certified Enterprise Architect for J2EE™ Technology Study Guide now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.