Design Patterns
OOP design patterns with interactive diagrams and code examples in TypeScript, Python, Java, and Go.
Design patterns are reusable solutions to commonly occurring problems in software design. Each pattern page includes a class diagram, implementation examples in all four languages, and a discussion of trade-offs.
Creational Patterns
These patterns deal with object creation mechanisms, aiming to create objects in a manner suitable to the situation.
| Pattern | Description |
|---|---|
| Singleton | Ensure a class has only one instance and provide a global access point |
| Factory Method | Define an interface for creating objects, letting subclasses decide which class to instantiate |
| Abstract Factory | Produce families of related objects without specifying their concrete classes |
| Builder | Construct complex objects step by step, separating construction from representation |
| Prototype | Clone existing objects without coupling to their classes |