The Single-Responsibility Principle (SRP)

A class should have only one reason to change.

The Open/Closed Principle (OCP)

Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification.
They are open for extension. This means that the behavior of the module can be extended. As the requirements of the application change, we can extend the module with new behaviors that satisfy those changes. In other words, we are able to change what the module does.
They are closed for modification. Extending the behavior of a module does not result in changes to the source, or binary, code of the module. The binary executable version of the module—whether in a linkable library, a DLL, or a .EXE file—remains untouched.

The Liskov Substitution Principle (LSP)

Subtypes must be substitutable for their base types.

The Dependency-Inversion Principle (DIP)

High-level modules should not depend on low-level modules. Both should depend on abstractions.
Abstractions should not depend upon details. Details should depend upon abstractions.

The Interface Segregation Principle (ISP)

Clients should not be forced to depend on methods they do not use.
No posts.
No posts.