What is SOLID principle? RRS feed

  • Question

  • What is SOLID principle in OO design?
    Sunday, September 27, 2015 6:32 AM

All replies

  • SOLID design is one of the core principles in Object oriented design. S - Single Responsibility Principle. A class should have one and only one responsibility. O- Open Closed Principle.Open for extension Closed for modification. L- Liskov Substitution Principle. This is equivalent to Polymorphism. I- Interface Segregation Principle.Client should not be forced to use a interface if it does not need it. D- Dependency inversion principle
    Sunday, September 27, 2015 6:42 AM
  • Hi,

    I recently spoke about SOLID. A definition:

    There is a pdf that you can download which contains a couple of examples for all of the solid principles.

    Rgds MM

    PS: Please mark as answer if helpful. Thanks!

    Tuesday, September 29, 2015 1:47 PM
  • This is one of my favorite places:
    Wednesday, October 21, 2015 3:10 AM
  • Nice link.

    I've said before I do worry about patterns, I realised the need and advantage but I do worry that when you have a hammer every problem looks like a nail

    Wednesday, October 21, 2015 1:25 PM
  • Hi Berehane,

    You could look into the below article. SOLID principle is must know principle for developer for efficient programming. Hope this helps you.

    SOLID Principles in C#


    Sabah Shariq

    Thursday, December 3, 2015 3:34 PM
  • SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion) stands for five basic principles of object-oriented programming and design. These principles help programmers create a system that is easy to maintain and extend over time.

    Single responsibility principle - every class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility.

    Open/closed principle - software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. Such an entity can allow its behaviour to be extended without modifying its source code.

    Liskov substitution principle - Substitutability principle states that, in a computer program, if S is a subtype of T, then objects of type T may be replaced with objects of type S (i.e., objects of type S may substitute objects of type T) without altering any of the desirable properties of that program (correctness, task performed, etc.).

    Interface segregation principle -  No client should be forced to depend on methods it does not use. ISP splits interfaces which 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 (role interfaces). This helps in keeping system decoupled and thus easier to refactor, change, and redeploy.

    Dependency inversion principle - Refers to decoupling software modules. A. High-level modules should not depend on low-level modules. Both should depend on abstractions. B. Abstractions should not depend on details. Details should depend on abstractions.

    Thanks, AT

    Thursday, December 3, 2015 4:01 PM
  • Hi Tripathi,

    Thank you for the detailed discussion around this topic.


    Thursday, May 11, 2017 5:08 PM
  • Great response, very helpful. Other readers submitted great ammount of quality materials.
    Sunday, May 28, 2017 9:12 AM