SOLID Principles in C#

Posted By : Bipul Kumar Tiwari,

What is SOLID?

SOLID are five basic principles . SOLID is an acronym for the first 5 principles of object-oriented design:

Single Responsibility Principle (SRP):

Single Responsibility Principle syas that a class should have only a single responsibility. Only one potential change in the software's specification should be able to affect the specification of the class.

Open/Closed Principle (OCP):

Open/Closed principle says that a class should be open for extension but closed for modification. Which means that you can add new features through inheritance but should not change the existing classes (other than bug fixes).

Liskov Substitution Principle (LSP):

Liskov Substitution Principle says that Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program. It ensures that a derived class does not affect the behaviour of the parent class, in other words that a derived class must be substitutable for its base class.

Interface Segregation Principle (ISP):

Interface Segregation Principle says that the Interface Segregation Principle states "that clients should not be forced to implement interfaces they don't use. Instead of one fat interface many small interfaces are preferred based on groups of methods, each one serving one sub module.".

Dependency Inversion Principle (DIP):

Dependency Inversion Principle says that the Dependency Inversion Principle (DIP) states that high-level modules/classes should not depend upon low-level modules/classes. Both should depend upon abstractions. Secondly, abstractions should not depend upon details. Details should depend upon abstractions.


About the Author

Its me BIPUL who is logically minded creative at heart , a good communicator , a self taught full stack developer. I constantly focuses on my thinking , reading , collecting and creating my work in a order to enhance my skills.

I discover new dimensions for growing bussiness with a proven record in creating database and programming. I have a strong technical skills as well as strong interpersonal skills. Read more...

Browse By Category

Popular Articles