SOLID Design principle – Principles of Object-Oriented Design

Pinterest LinkedIn Tumblr

SOLID is a mnemonic acronym for five design principles intended to make software designs more understandable, flexible, and maintainable. The object-oriented analysis and design explain the system interaction and design the software effectively.  The design pattern explains the set of best practices provided by the industry for a long time.

The SOLD design principles explained in the following

  • Single Responsibility principle
  • Open closed principle
  • Liskov substitution principle
  • Interface segregation principle
  • Dependency inversion principle

Single Responsibility principle

A class should have only one reason to change.

The single responsibility principle is an object-oriented design principle that expects every module or class should have a single responsibility and encapsulate by the module or class. If any other object requires, it should encapsulate by another class and call using as the container. The software module or microservice follows the same and should not allow changing for different reasons.

For example, the classroom contains a student, teacher, whiteboard, books, tables, and pen. The software design must contain appropriate roles and responsibilities for each object. The classroom should not control the student directly and can contain student class. If classroom requests, it encapsulated by student class.

Open Closed principle

Software entities like classes, modules and functions should be open for extension but closed for modifications.

The open-closed principle that expects the class or module should be open for extension.  The class can be extended by one or more interfaces. The software system interacts through interfaces and implementation uses containment for communication. If the class wants to extend other futures, it implements another interface and Implements the methods. The design pattern helps to close the state. The client can not update the state directly and encapsulate through methods.

Liskov-substitution principle

Derived types must be completely substitutable for their base types.

The Liskov-substitution principle expects the derived/implemented classes should be substitutable with the base class or interface. If the base class has common methods and call uniformly with all the callers. The implementation may be different based on the requirement. The java interface uses to assign the implementation.  Example, List<String> listEmployee = new ArrayList<>(). The List interface contains common contracts and implemented with a different derived class. If the programmer willing to change the implementation, the programmer can change only the definition.

Interface segregation principle

Clients should not be forced to depend upon interfaces that they do not use.

Interface segregation principle splits interfaces that are very large into smaller and more specific ones. The clients will only have to know about the methods that are of interest to them. Example The user defines an interface for the bird. All the birds may not fly and may segregate the interface into Birds and FlyingBirds. The birds may be marker interface and do not have any methods. The FlyingBirds contains the fly() method.  The designer should define the interface design properly for decoupling the systems or modules.

Dependency inversion principle

High-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend on details. Details should depend on abstractions.

A dependency inversion principle is a specific form of decoupling software modules. The higher-level module and lower-level module should always interact though the contact interfaces. If any class or module interact with each other, it should not call the method directly. The high- and low-level components interact through the interface.


  1. I think the admin of this website is truly working hard for his
    website, as here every stuff is quality based material.

  2. Great blog! Do you have any helpful hints for aspiring writers?
    I’m planning to start my own website soon but I’m a little lost on everything.

    Would you suggest starting with a free platform like WordPress or go for a paid option? There
    are so many choices out there that I’m completely overwhelmed ..
    Any recommendations? Thanks a lot!

  3. Can I simply say what a comfort to find somebody that genuinely knows what they’re discussing on the internet.
    You certainly realize how to bring an issue to light and make it important.
    A lot more people ought to check this out and understand this side
    of your story. I can’t believe you aren’t
    more popular because you certainly have the gift.

  4. You really make it seem really easy along with your
    presentation but I find this matter to be really something
    that I believe I might never understand. It seems too complicated and very broad for me.
    I’m taking a look forward in your next submit,
    I’ll try to get the hang of it!

  5. Hello. This article was extremely motivating, especially since I was looking for thoughts on this issue last Saturday. Pavia Rex Tamah

  6. I have been checking out some of your articles and i can state pretty nice stuff. I will surely bookmark your blog. Dorie Syd Rozella

  7. This post will assist the internet viewers for creating new website or even a blog from start to end. Deane Ive Zena

  8. I’m not sure where you’re getting your info, but good topic.
    I needs to spend some time learning much more or understanding more.
    Thanks for magnificent info I was looking for this
    info for my mission.

Write A Comment