Principle Clinic
Learn SOLID and GRASP by reviewing C# code. 9 lessons with before and after examples, a code review game with 24 pull requests, 32 quiz questions and a cheat sheet.
SOLID and GRASP principles explained with C#
Principle Clinic teaches the five SOLID principles and the nine GRASP patterns through C# before and after examples, a code review game and 32 quiz questions. It suits developers preparing for interviews and reviewers who want a shared vocabulary for design feedback.
SOLID
- Single Responsibility: one reason to change.
- Open/Closed: extend without modifying.
- Liskov Substitution: subtypes keep the base contract.
- Interface Segregation: no client depends on methods it does not use.
- Dependency Inversion: depend on abstractions.
GRASP
Information Expert, Creator, Controller, Low Coupling, High Cohesion, Polymorphism, Pure Fabrication, Indirection and Protected Variations.
Frequently asked questions
What are the SOLID principles?
SOLID is five object-oriented design principles: Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation and Dependency Inversion. They make code easier to change, test and extend.
What is GRASP in software design?
GRASP (General Responsibility Assignment Software Patterns) is a set of nine patterns by Craig Larman for deciding which class gets which responsibility: Information Expert, Creator, Controller, Low Coupling, High Cohesion, Polymorphism, Pure Fabrication, Indirection and Protected Variations.
What is the difference between SOLID and GRASP?
SOLID gives rules for shaping classes and dependencies. GRASP helps you decide where each responsibility belongs. They overlap: Protected Variations is close to Open/Closed, and Low Coupling supports Dependency Inversion.
Is Dependency Inversion the same as dependency injection?
No. Dependency Inversion is a design principle about depending on abstractions. Dependency injection is a technique for supplying those dependencies, often with a container.
Can you overuse SOLID?
Yes. An interface and factory for every class adds ceremony without value. Apply YAGNI and KISS: add abstractions when a real second implementation or a test seam appears.
Progress, XP and badges are saved in your browser only.