Creational Design Patterns

Kyle Jensen
5 min readJul 10, 2023

--

Creational design patterns focus on abstracting the instantiation process. They aid in making a system independent of how its objects are created, composed, and represented. Creational design patterns can be categorized into two groups, class creational patterns, which use inheritance, and object creational patterns, which delegate instantiation to another object. In this post, we’ll lightly discuss 5 creational patterns noted by The Gang of Four.

Abstract Factory

Let’s start with the abstract factory. The abstract factory pattern allows you to create multiple objects that follow a general pattern. It’s best used when the client doesn’t rely on how you create and compose objects or when the system has multiple families of objects that are designed to be used together.

The abstract factory is an object used to create families of objects. While the factory method removes the specifics about the way that objects are created, the abstract factory removes the specifics about how those factories are created. Because of this, the abstract factory is also commonly known as the “Factory factory”.

This design pattern finds its strength in creating pre-defined objects, but creating new types of objects involves altering the abstract factory class itself as well as all of its subclasses. The general breakdown of this…

--

--

Kyle Jensen

SWE turned 2x founder, writing about crypto, AI, tech, business, & economics. Previously The Washington Post, Gitcoin, Various Startups, Northwestern Economics