Top 10 Object Oriented Design Principles
- DRY (Don’t repeat yourself) - avoids duplication in code
- Encapsulate what changes - hides implementation detail, helps in maintenance
- Open Closed design principle - open for extension, closed for modification
- SRP (Single Responsibility Principle) - one class should do one thing and do it well
- DIP (Dependency Inversion Principle) - don’t ask, let framework give to you
- Favor Composition over Inheritance - Code reuse without cost of inflexibility
- LSP (Liskov Substitution Principle) - Sub type must be substitutable for super type
- ISP (Interface Segregation Principle) - Avoid monolithic interface, reduce pain on client side
- Programming for Interface - Helps in maintenance, improves flexibility
- Delegation principle - Don’t do all things by yourself, delegate it
SOLID: https://scotch.io/bar-talk/s-o-l-i-d-the-first-five-principles-of-object-oriented-design
This post is licensed under CC BY 4.0 by the author.