Library
Patterns
A growing set of design patterns with implementation notes, tradeoffs, and cross-stack integration guidance.
Abstract Factory
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.
Builder
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.
Factory Method
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.
Prototype
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.
Singleton
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.