Master the foundations of clean software architecture. Explore SOLID Principles, 23 Gang-of-Four Design Patterns, UML Class Relationships, and Refactoring Best Practices.
5 core guidelines for maintainable and scalable Object-Oriented software.
class OrderRepository {
save(order: Order): void { ... }
}"A class should have one, and only one, reason to change."
interface PaymentStrategy {
pay(amount: number): void;
}"Software entities should be open for extension, but closed for modification."
interface FlyingBird extends Bird {
fly(): void;
}"Subtypes must be substitutable for their base types without breaking application behavior."
interface Printer {
print(doc: Document): void;
}"Clients should not be forced to depend on interfaces they do not use."
constructor(private sender: MessageSender) {}"High-level modules should not depend on low-level modules. Both should depend on abstractions."
Reusable solutions to common object-oriented design challenges.
Defines an interface for creating objects, but lets subclasses decide which class to instantiate.
Provides an interface for creating families of related or dependent objects without specifying concrete classes.
Separates the construction of a complex object from its representation, enabling step-by-step construction.
Ensures a class has only one instance while providing a global access point to this instance.
Creates new objects by copying an existing instance (cloning) to save expensive initialization.
Allows objects with incompatible interfaces to collaborate by converting one interface into another.
Attaches new behaviors to objects dynamically by placing them inside special wrapper objects.
Provides a simplified interface to a library, a framework, or any other complex set of classes.
Composes objects into tree structures to represent part-whole hierarchies cleanly.
Provides a surrogate or placeholder for another object to control access, lazy load, or log.
Decouples an abstraction from its implementation so that the two can vary independently.
Fits more objects into available RAM by sharing common parts of state among multiple objects.
Defines a family of algorithms, encapsulates each one, and makes them interchangeable at runtime.
Defines a subscription mechanism to notify multiple subscriber objects about events.
Allows an object to alter its behavior when its internal state changes, appearing to change its class.
Encapsulates a request as a standalone object containing all information about the request.
Passes requests along a chain of handlers until one of the handlers processes the request.
Defines the skeleton of an algorithm in the superclass but lets subclasses override specific steps.
Accesses elements of an aggregate object sequentially without exposing its underlying representation.
Reduces chaotic dependencies between objects by restricting direct communications to a mediator.
Saves and restores the previous state of an object without revealing the details of its implementation.
Separates algorithms from the objects on which they operate by adding visitor operations.
Evaluates sentences in a language by defining a grammatical representation.