Skip to content

jatinlanje/SOLID

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Solid

SOLID is an acronym for the first five object-oriented design (OOD) principles by Robert C. Martin (also known as Uncle Bob).


Single-Responsibility Principle

There should never be more than one reason for a class/code unit to change. Every class should have only one responsibility. It will enable to keep specific functionality to be present in specific classes.

Single-Responsibility Principle

Open-Closed Principle

Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. Existing functions in the class should be used and they should not be changed or modified to enable new functionality. New changes should be added in such a way such that little to minimum change needs to be done in existing code.

Open-Closed Principle

Liskov Substitution Principle

Extend properties of parent not narrow it down. If child class is not able to provide the result or type of result as that of parent class, it indicates violation of principle.

Liskov Substitution Principle

Interface Segregation Principle

Interface should be such a class do not need to implement unecessary functions. This is similar to single responsibility principle. This enables to add specific interfaces for specific functionalities. This will reduce implementation of methods which will be unused and promotes modularity and reusability.

Interface Segregation Principle

Dependency Inversion Principle

Rely on abstractions, not on concrete implementations. High level modules should not depend on low level modules. Both should depend on abstraction. Abstaraction should not depend on details . Details should depend upon abstraction. This is done to reduce tight coupling and it allow us to create extensible classes.

Dependency Inversion Principle

Releases

No releases published

Packages

No packages published

Languages