Object-Oriented Design Patterns

Object-oriented design patterns implemented in TypeScript, from the book Design Patterns: Elements of Object-Oriented Sofware, by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, also known as the Gang of Four.

Abstract Factory Pattern

Posted by Dustin Boston in .

The Abstract Factory Pattern is a creational design pattern that enables the creation of families of related objects without specifying their concrete classes, promoting consistency and flexibility.

Adapter Pattern

Posted by Dustin Boston in .

The Adapter Pattern is a structural design pattern that helps incompatible interfaces work together by using an adapter class. This article explains how it works and its benefits in software development.

Bridge Pattern

Posted by Dustin Boston in .

The Bridge Pattern is a structural design pattern that decouples an abstraction from its implementation, enabling flexibility and scalability in software design.

Builder Pattern

Posted by Dustin Boston in .

The Builder Pattern is a creational design pattern that decouples the construction of complex objects from their representation, allowing for flexibility and reuse in object creation.

Command Pattern

Posted by Dustin Boston in .

The Command Pattern is a behavioral design pattern that encapsulates requests as objects, enabling parameterization, queuing, and logging of operations for greater flexibility in software design.

Composite Pattern

Posted by Dustin Boston in .

The Composite Pattern is a structural design pattern that enables you to compose objects into tree structures to represent part-whole hierarchies, simplifying the management of complex object structures.

Decorator Pattern

Posted by Dustin Boston in .

The Decorator Pattern is a structural design pattern that enables dynamic addition of behavior to individual objects without modifying their class, promoting flexibility and reusability in software design.

Factory Method Pattern

Posted by Dustin Boston in .

The Factory Method Pattern is a creational design pattern that defines an interface for creating objects, allowing subclasses to decide which class to instantiate, promoting flexibility and scalability in object creation.

Memento Pattern

Posted by Dustin Boston in .

The Memento Pattern is a behavioral design pattern that allows capturing and restoring an object’s state, enabling undo functionality and preserving encapsulation.

Observer Pattern

Posted by Dustin Boston in .

The Observer Pattern is a behavioral design pattern that establishes a one-to-many dependency between objects, enabling automatic updates to dependents when the subject’s state changes.

Prototype Pattern

Posted by Dustin Boston in .

The Prototype Pattern is a creational design pattern that facilitates object cloning, enabling the creation of new objects by copying existing ones and promoting flexibility in object creation.

Proxy

Posted by Dustin Boston in .

The Proxy Pattern is a structural design pattern that provides a surrogate or placeholder for another object, controlling access and adding functionality without modifying the original object.

State Pattern

Posted by Dustin Boston in .

The State Pattern is a behavioral design pattern that enables an object to change its behavior dynamically based on its internal state, promoting cleaner and more maintainable code.

Strategy Pattern

Posted by Dustin Boston in .

The Strategy Pattern is a behavioral design pattern that allows the selection of algorithms at runtime by encapsulating them in separate classes, promoting flexibility and reusability.

Visitor Pattern

Posted by Dustin Boston in .

The Visitor Pattern is a behavioral design pattern that enables adding new operations to existing object structures without altering their classes, promoting flexibility and maintainability.