Library
Patterns
A growing set of design patterns with implementation notes, tradeoffs, and cross-stack integration guidance.
Adapter
Allow incompatible interfaces to work together without changing the consuming code.
Problem: A client needs to talk to a legacy class or external service whose interface does not match the rest of the codebase.
Languages: typescript, java, python, go, csharp, dotnet, react, angular, react-native
Integration: Adapters are useful when exposing a stable boundary over a legacy API, vendor SDK, or payload format mismatch.
Bridge
Decouple abstractions from implementations so they can evolve independently.
Problem: When an abstraction is tightly coupled to its implementation, changing one side forces changes in the other and makes the system harder to evolve.
Languages: typescript, java, python, angular, react, react-native, csharp, dotnet, go
Integration: Bridge is useful when you want one stable abstraction while swapping implementations for providers, environments, or device targets.
Composite
Compose objects into tree structures to represent part-whole hierarchies and let clients work with individual and composite objects through the same interface.
Problem: A system needs to treat individual objects and groups of objects uniformly, but the hierarchy becomes difficult to manage with separate code paths.
Languages: typescript, java, python, angular, react, react-native, csharp, dotnet
Integration: Composite is useful when a hierarchy of nested objects should expose a common interface, such as files and folders, menus and submenus, org charts, widget trees, or scene graphs.
Decorator
Wrap an object with other objects that implement the same contract so responsibilities can be layered dynamically.
Problem: A system needs to add optional behaviors to an object without creating many subclasses for every feature combination.
Languages: typescript, java, python, angular, react, react-native, csharp, dotnet
Integration: Decorators work well for cross-cutting concerns such as logging, retry, caching, compression, and telemetry because each layer keeps the same interface while adding one concern.
Facade
Provide a simplified high-level interface that coordinates a complex subsystem behind a smaller and easier-to-use API.
Problem: A client needs to perform a recurring workflow that spans several subsystem classes, but direct coordination makes the code noisy and tightly coupled.
Languages: typescript, java, python, angular, react, react-native, csharp, dotnet
Integration: Facades are useful when exposing a stable boundary over a multi-service or mixed-language backend, or when presenting a consistent UI entry point over multiple readiness checks.
Flyweight
Use sharing to support large numbers of fine-grained objects efficiently by separating shared intrinsic state from per-object extrinsic state.
Problem: A system creates a large number of similar objects, but storing all of their state separately uses too much memory.
Languages: typescript, java, python, angular, react, react-native, csharp, dotnet
Integration: Flyweight is useful when thousands or millions of similar objects need to be represented efficiently, such as trees, glyphs, tiles, or UI tokens.
Proxy
Provide a surrogate or placeholder for another object to control access to it.
Problem: A client needs to interact with an object indirectly because the real object may be expensive, sensitive, or remote.
Languages: typescript, java, python, angular, react, react-native, csharp, dotnet
Integration: Proxy is useful for lazy loading, access control, caching, logging, and remote service wrappers.