Creational Patterns

Polymorphism allows us to decouple the behavior of a system from the behavior of its components.

Unfortunately, polymorphism doesn't allow us to decouple the construction of a system from the construction of its components.

The patterns in this section allow us to do this and more.

We begin with the Factory Method Pattern. This pattern allows us to decouple the behavior of an object from how it is created.

The Abstract Factory and Builder Patterns allow us to decouple the construction of a system from the construction of its components.

The Singleton Pattern is used when there can be at most one instance of a class.

The Prototype Pattern is used when objects must be created from their descriptions.

The Interning Pattern is used when we want  to avoid multiple objects that are logically equivalent.

Many of these patterns can be seen in the MazeMaker case study.

To practice these patterns try some of the exercises in Creation Pattern Labs.