Library

Patterns

A growing set of design patterns with implementation notes, tradeoffs, and cross-stack integration guidance.

5 patterns

Abstract Factory

Creational

Provide an interface for creating families of related objects without specifying their concrete classes.

Problem: Client code needs to create families of related objects, but hardcoding concrete classes makes the code rigid and hard to swap.

Languages: typescript, java, python, react, angular, csharp, dotnet

Integration: Abstract Factory is especially useful when your app must produce matching sets of related objects for a theme, provider, platform, or pipeline.

View pattern

Builder

Creational

Separate the construction of a complex object from its final representation.

Problem: Constructing complex objects directly can make required steps, optional values, and validation hard to manage.

Languages: typescript, python, java, react, angular, go, csharp, dotnet

Integration: Builder is most useful when construction must happen in controlled steps and the final object has many optional or ordered parts.

View pattern

Factory Method

Creational

Define a creation method behind a common interface so specialized creators can decide which concrete product to instantiate without changing the surrounding workflow.

Problem: A workflow needs to create one of several related concrete objects, but constructing them directly in client code spreads creation logic and tightly couples the caller to specific implementations.

Languages: typescript, java, python, angular, react, react-native, csharp, dotnet

Integration: Factory Method is useful when framework hooks, integrations, or environment-specific workflows need to create interchangeable implementations behind a stable contract.

View pattern

Prototype

Creational

Specify the kinds of objects to create using a prototypical instance, and create new objects by cloning that prototype.

Problem: Creating new objects from scratch can be expensive or repetitive when the system needs many similar variants.

Languages: typescript, java, python, angular, react, react-native, csharp, dotnet

Integration: Prototype is useful when object creation is expensive, when many near-identical objects are needed, or when cloning preconfigured templates is simpler than rebuilding them.

View pattern

Singleton

Creational

Ensure a class has only one instance and provide a global access point to it.

Problem: A system needs exactly one shared instance of a class, and that instance must be globally accessible without allowing uncontrolled duplication.

Languages: typescript, java, python, angular, react, react-native, csharp, dotnet

Integration: Singleton is useful for centralized services like configuration, logging, caching, and shared application state.

View pattern