Contains programming concepts with some sample for guidance
S | SRP | Single Responsibility Principle
Definition:
“Each module should do one thing and do it well.”
O | OCP | Open-Closed Principle
Definition:
“You should be able to use and add to a module without rewriting it.”
L | LSP | Liskov Substituion Principle
Definition:
"You should be able to substitute one thing for another if those things are declared to behave the same way."
I | ISP | Interface Segregation Principle
Definition:
“Don’t show your clients more than they need to see”.
D | DI | Dependency Inversion
Definition:
“Depend upon abstractions, not concretions.”
Reference Material:
SOLID StackOverflow
Conclusion:
To restate “modern SOLID” one more time:
- Don’t surprise the people who read your code.
- Don’t surprise the people who use your code.
- Don’t overwhelm the people who read your code.
- Use sane boundaries for your code.
- Use the right level of coupling—keep things together that belong together, and keep them apart if they belong apart.