SOLID design principles

SOLID design principles are a set of basic OOD design principles. These principles were first published by Robert C. Martin, popularly known as Uncle Bob. He is also a coauthor of the Agile Manifesto.

S.O.L.I.D stands for five primary class design principles:

  • Single Responsibility Principle (SRP): A class should have only one reason to change, which means that a class should have only one primary job to do; an extension can be added, for example, inheritance.
  • Open Closed Principle (OCP): A class should be designed in such a way that it is open for the extension of its behavior but is closed for modification in itself.
  • Liskov Substitution Principle (LSP): All of the derived classes should be substitutable (replaceable) with their parent class.
  • Interface Segregation Principle (ISP): Interfaces should be fine-grained and client-specific. Let's say that a client should never be forced to implement an interface that they don't need or use.
  • Dependency Inversion Principle (DIP): Depend only on abstractions rather than on concretions. Abstractions should not depend on details (or implementations); instead, details should depend on the abstractions.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.107.229