SOLID is a set of 5 design principles of Object Oriented Design in software engineering intended to make software development more- Flexible Easier to maintain Easier to understand.
2. 2
SOLID- What does mean it?
SOLID is a set of 5 design principles of Object Oriented Design in software engineering intended to make
software development more-
Flexible
Easier to maintain
Easier to understand
3. 3
What is SOLID?
The SOLID principles of Object Oriented Design include these five principles:
S Single Responsibility (SRP)
O Open/Closed Principle (OCP)
L Liskov Substitution Principle (LSP)
I Interface Segregation Principle (ISP)
D Dependency Inversion (DIP)
4. 4
Why we should care?
Cleaner code
Code smells are kept away
Codebase that is maintainable, expandable & understandable
Usually integrated in Agile methodologies, i.e. Scrum
Loose coupling (DIP)
11. 1111
Liskov Substitution Principle
11
Functions that use pointers or references to base
classes must be able to use objects of derived classes
without knowing it.
Example:
If Child is a Subtype of Parent then objects of type Parent
may be replaced with objects of type Child
14. 1414
Interface Segregation Principle
14
Clients should not be forced to depend upon interfaces that
they do not use.
Example:
Our client are totally independent because if they are not able to
take features. If needed in future than they can.
16. 1616
Dependency Inversion Principle
16
High-level modules should not depend on low-level
modules. Both should depend on abstractions (e.g.
interfaces).
Abstractions should not depend on details. Details
(concrete implementations) should depend on abstractions.
N.B: Implementation Business Logic Layer/Data Access Layer