Posted by & filed under Design Patterns, Programming.

In Software development there are set of principles which are called the SOLID principles. These are

  • Single responsibility principle.
  • Open/Closed principle.
  • Liskov Substitution principle.
  • Interfage Segregation Principle.
  • Dependency Inversion Principle.

Single responsibility principle:
While developing software, underlying components should have single responsibility. Benefit of this principle is loose coupling and high cohesion. The component should be specialized doing only one thing.

Open/Closed principle:
With open/closed principle software components/entities should be open for extension and closed for modification. Benefit of this principle is also loose coupling and high cohesion.

Liskov Substitution principle:
While developing software it is highly recommended to program to an interface rather than programming to a implementation. Also known as program to a contract. In this context programming to an interface both contains Interfaces and Abstract classes. Due to polymorphism, you should be able to substitute an implementation with another implementation due to this principle.

Interface segregation principle:
while developing software we said programming to an interface is good. However, it is not quite good to make a single interface and implement that. Interface segregation suggests us that interfaces should be highly cohesive and specialized. Obviously this will provide us high cohesion.

Dependency Inversion principle:
Dependency inversion principle tells us that we should build our software depending on abstractions not implementations which will provide us loose coupling. In this context abstractions means programming to an interface, just to be clear.

This is kinda small summary about SOLID principles. There are many other principles in the same context which will be forth coming.

Leave a Reply

You must be logged in to post a comment.