SOLID principles

Kishor Sutar
1 min readAug 26, 2017

--

In 1990s Robert C Martin gathered 5 principles of object-oriented class design, presenting them as best guide lines for building a maintainable object oriented design system. Michel Feathers attached acronym SOLID these principles in the early 2000s.

Single Responsibility Principle (SRP)-

Classes should have one reason to change, Keep your classes small and single-purposed.

Open Closed Principle (OCP)-

Design classes to be open for extensions but closed for modifications. Minimize the need to change to extensions.

Liskov Substitution Principle(LSP)-

Subtypes should be substitutional for their base types. From clients perspective, override methods shouldn’t break functionality.

Interface Segregation Principle(ISP)-

Client should not be forced to depend on methods they don’t use. Split a larger interface into a number of smaller interfaces.

Dependency Inversion Principles(DIP)-

High level modules should not depend on low level module; both should depend on abstractions. Abstraction should not depend on details; details should depend on abstractions.

You can and should read more about SOLID at Wikipedia — https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)

--

--