New
Open Closed Principle (OCP): Extend Without Breaking
Learn how the Open Closed Principle (OCP) lets you add new features without touching existing code. Includes C# examples of dynamic and static polymorphism.
Code that looked fine — until it wasn't. That's where each principle begins.
Learn how the Open Closed Principle (OCP) lets you add new features without touching existing code. Includes C# examples of dynamic and static polymorphism.
A subtype that breaks its parent's promise is an LSP violation. Learn Design by Contract, see a broken gift card hierarchy, and how to fix it with interfaces.
DIP is the mechanism behind OCP. Learn why policy shouldn't depend on details, see a broken report generator, and how inverting dependencies fixes it.