5 S.O.L.I.D Design principles of Object Oriented Programming

Uncle Bob (Robert C. Martin)  gave us greate first 5 design principles for Object Oriented Programming known as S.O.L.I.D.


  • S – Single-responsiblity principle    
  • O – Open-closed principle                
  • L – Liskov substitution principle
  • I – Interface segregation principle
  • D – Dependency Inversion Principle

Let’s go over all principles and understand them through example.

1 ) S – Single-responsiblity principle   :

Class should have one and only one job.

2) O – Open-closed principle  :

Objects or entities should be open for extension, but closed for modification.

3)  L – Liskov substitution principle

Derived types must be completely substitable for its base/parent class.

4) I –Interface segregation principle

Client should be forced to implement unneccessary method/functions which they will not use.

5) D – Dependency Inversion Principle

Entities must depend on abstraction, not on concreation.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s