Design Principles
Learn SOLID, DRY, KISS, YAGNI, and other principles for building maintainable software.
At senior levels, design reviews and architecture discussions separate engineers who can name why a design is wrong from those who default to "it works." Rigid codebases, endless refactors, and circular debates are usually symptoms of missing shared language—SOLID, DRY, and the classic patterns.
These topics give you that language: when each principle and pattern applies, how to spot violations in real code, and how to articulate trade-offs. You'll signal judgment and clarity whether you're proposing a design in a review or defending choices in an interview.
Topics in this category
SOLID Principles: Principles, Trade-offs & Examples
Read →Master SOLID principles (SRP, OCP, LSP, ISP, DIP) to design maintainable, testable software. Learn when to apply each principle and how they work together.
DRY, KISS & YAGNI
Read →Master DRY: eliminate duplication by extracting common logic. Learn when to apply this principle and how it improves maintainability and reduces bugs.
KISS — Keep It Simple, Ship It
Read →KISS emphasizes clarity over cleverness. Learn to reduce hidden state, optimize for common cases, and choose names that tell the story effectively and clearly.
YAGNI — You Aren't Gonna Need It
Read →YAGNI prevents premature optimization and over-engineering. Learn to delay generalization, scope to real requests, and build only what you need now, not later.
Separation of Concerns
Read →Partition systems by the decisions they protect to keep change local and safe. Learn to separate concerns effectively for maintainable, scalable architecture.
Composition Over Inheritance
Read →Learn when to prefer composition over inheritance. Model behavior with combinable units for explicit, testable changes. Avoid fragile base classes and coupling.
Singleton Pattern: Principles, Trade-offs & Examples
Read →Learn the Singleton pattern: ensure a class has only one instance with global access. Understand when to use it, common pitfalls, and better alternatives.
Factory Pattern: Principles, Trade-offs & Examples
Read →Learn the Factory pattern: create objects without specifying exact classes. Master Factory Method and Abstract Factory patterns with practical examples.
Builder Pattern: Principles, Trade-offs & Examples
Read →Learn the Builder pattern: construct complex objects step by step. Separate construction from representation and create objects with many optional parameters.
Observer Pattern: Principles, Trade-offs & Examples
Read →Learn the Observer pattern: define a one-to-many dependency between objects. When one object changes state, all dependents are notified automatically.
Strategy Pattern: Principles, Trade-offs & Examples
Read →Learn the Strategy pattern: define algorithm families, encapsulate each one, and make them interchangeable. Algorithms vary independently from clients.
Adapter Pattern: Principles, Trade-offs & Examples
Read →Learn the Adapter pattern: allow incompatible interfaces to work together. Convert class interfaces into formats clients expect for seamless integration.
Decorator Pattern: Principles, Trade-offs & Examples
Read →Learn the Decorator pattern: attach responsibilities to objects dynamically. A flexible alternative to subclassing for extending functionality at runtime.
Command Pattern: Principles, Trade-offs & Examples
Read →Learn the Command pattern: encapsulate a request as an object, allowing you to parameterize clients with different requests, queue operations, and support undo.
Composite Pattern: Principles, Trade-offs & Examples
Read →Learn the Composite pattern: compose objects into tree structures to represent part-whole hierarchies. Treat individual objects and compositions uniformly.
Proxy Pattern: Principles, Trade-offs & Examples
Read →Learn the Proxy pattern: provide a surrogate or placeholder for another object to control access to it. Understand virtual, protection, and remote proxies.