SOLID principles
One of the most common acronyms you will come across as a .NET developer is SOLID, which stands for the following principles, each of which have their own acronym:
- Single Responsibility Principle (SRP)
- Open/Closed Principle (OCP)
- Liskov Substitution Principle (LSP)
- Interface Segregation Principle (ISP)
- Dependency Inversion Principle (DIP)
The SOLID principles are primarily designed for Object-Oriented Programming (OOP), but their core concepts can be adapted and applied to other programming paradigms like functional programming or procedural programming as well.
Principles are harder to follow than rules. Rules are explicit and specific. Principles are broad and abstract. To follow a principle, you need to interpret how they apply to your situation and judge the extent to which you follow them.
Let’s review each of these five principles in turn.
Single Responsibility Principle (SRP)
The...