SOLID |
---|
Principles |
In software programming, SOLID is a mnemonic acronym for five design principles intended to make object-oriented designs more understandable, flexible, and maintainable. Although the SOLID principles apply to any object-oriented design, they can also form a core philosophy for methodologies such as agile development or adaptive software development. [1]
Software engineer and instructor Robert C. Martin [2] [3] [1] introduced the basic principles of SOLID design in his 2000 paper Design Principles and Design Patterns about software rot. [3] [4] : 2–3 The SOLID acronym was coined around 2004 by Michael Feathers. [5]
The single-responsibility principle (SRP) states that "there should never be more than one reason for a class to change." [6] In other words, every class should have only one responsibility. [7]
The open–closed principle (OCP) states that "software entities ... should be open for extension, but closed for modification." [8]
The Liskov substitution principle (LSP) states that "functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it." [9] [9]
The interface segregation principle (ISP) states that "clients should not be forced to depend upon interfaces that they do not use." [10] [4]
The dependency inversion principle (DIP) states to depend upon abstractions, [not] concretes. [11] [4]