SOLID Principle
methods to these madness
Published in
1 min readAug 23, 2022
5 software design principles to help craft cleaner & scalable code. They are also easy to remember for an interview.
- Single responsibility principle: Each class in a software program should have a single responsibility.
- Open-Closed principle: A class should be open for extension — you should be able to add new functionality to it. It should also be closed to modification — the changes you make should not break existing code.
- Liskov substitution principle: Subclasses should be substitutable for their base classes.
- Interface segregation principle: Create new objects that implement existing interfaces for additional functionality.
- Dependency inversion principle: Abstractions should not depend on details. Details should depend on abstractions. High-level modules should not depend on low-level modules. Both should depend on abstractions.
👀 lest I forget
References & Further Reading: