WEEK - 5 SOLID Principles
WEEK - 5 SOLID Principles
Principles
ZUNERA ZAHID
2
Main Concept
Dependency Inversion
4
Single Responsibility Principle
Single
Responsibility
Principle
6
Single
Responsibility
Principle
7
Single
Responsibility
Principle
Open –
closed
Principle
9
Open –
closed
Principle
10
Liskov
Substitution
principle
14
Liskov
Substitution
principle
15
Interface Segregation Principle
Interface
Segregation
Principle
17
Interface
Segregation
Principle
18
Interface
Segregation
Principle
Interface
Segregation
Principle
20
Interface Segregation
Principle
21
Dependency
inversion
principle
22
Dependency inversion principle
If class "A" has two responsibilities, create new classes "B" and "C" to
handle each responsibility in isolation, and then compose "A" out of "B"
and "C"
Every class should be open for extension (derivative classes), but closed
for modification (fixed interfaces)
Put the system parts that are likely to change into implementations (i.e.
SOLID Design
concrete classes) and define interfaces around the parts that are unlikely
to change (e.g. abstract base classes)
Any algorithm that works on the interface, should continue to work for any
substitute implementation
23