The tutorial of today is about SOLID.
There are three specific causes of change: adding new features, correcting faults, and restructuring code to accommodate future changes.
This is the reason for the five design principles intended to make software designs more understandable, flexible, and maintainable known as SOLID.
The SOLID principles are not rules.
SOLID is an acronym for the first five object-oriented design (OOD) principles by Robert C. Martin (also known as Uncle Bob).
SOLID stands for:
- S – Single-responsibility Principle;
- O – Open-closed Principle;
- L – Liskov Substitution Principle;
- I – Interface Segregation Principle;
- D – Dependency Inversion Principle;
Single-responsibility Principle (SRP) refers to a class that should have one and only one reason to change, meaning that a class should have only one job.
The open-closed Principle (S.R.P.) tells us about objects or entities should be open for extension but closed for modification.
The Liskov Substitution Principle comes with this: let q(x) be a property provable about objects of x of type T. Then q(y) should be provable for objects y of type S where S is a subtype of T.
Interface Segregation Principle: A client should never be forced to implement an interface that it doesn’t use it or clients shouldn’t be forced to depend on methods they do not use.
The Dependency Inversion Principle is about entities that must depend on abstractions, not on concretions. It states that the high-level module must not depend on the low-level module, but should depend on abstractions.