Pages

5 Solid Principles to make your design SOLID and CONCRETE


5 solid principles:

1. SRP -Single Responsibility Principle : A class should have one and only one reason to change, meaning that a class should have only one job.

2. OCP -Open/Closed Principle : You should be able to extend a classes behavior, without modifying it.Objects or entities should be open for extension, but closed for modification.

3. LSP - Liskov Substitution Principle : Derived classes must be substitutable for their base classes. A client should never be forced to implement an interface that it doesn't use or clients shouldn't be forced to depend on methods they do not use.

4. ISP - Interface Segregation Principle : Make fine grained insetad of FAT interfaces that are client specific.

5. DIP-Dependency Inversion Principle : Entities must depend on abstractions not on concretions. It states that the high level module must not depend on the low level module, but they should depend on abstractions.