-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSOLID Principles
27 lines (22 loc) · 1.44 KB
/
SOLID Principles
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
S - Single Responsibility
O - Open-closed
L - Liskov Substitution
I - Interface Segregation
D - Dependency Inversion
Single Responsibility :
Do not try to overload class with different purpose. Put similar actions/members inside single class.
Open-Closed :
Open for extension and closed for modification. design in such a way that, in case of new requirements comes, code changes
would be adding/extending but not modifying the logic in esisting procedure.
Liskov Substitution :
Simply put, the Liskov Substitution Principle (LSP) states that objects of a superclass should be replaceable with
` objects of its subclasses without breaking the application. In other words, what we want is to have the objects of
our subclasses behaving the same way as the objects of our superclass
Interface Segregation :
In the field of software engineering, the interface segregation principle (ISP) states that
no code should be forced to depend on methods it does not use. ISP splits interfaces that are very large into smaller
and more specific ones so that clients will only have to know about the methods that are of interest to them
Dependency Inversion
The Dependency Inversion Principle focuses on making high-level and low-level modules depend on abstractions,
while Dependency Injection is a technique for providing these abstractions to the modules at.
Means parent ones must not be dependent on child implementation.