"In computer programming, SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion) is a mnemonic acronym introduced by Michael Feathers for the "first five principles" identified by Robert C. Martin[1][2] in the early 2000s[3] that stands for five basic principles of object-oriented programming and design"
S.O.L.I.D introduced: Design Principles and Design Patterns, by Robert C. Martin, www.objectmentor.com (known as "Uncle Bob")
InfoQ presentation: SOLID Software and Design Patterns for Mere Mortals
S SRP
Single responsibility principle
an object should have only a single responsibility.
O OCP
Open/closed principle
“software entities … should be open for extension, but closed for modification”.
L LSP
Liskov substitution principle
“objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program”. See also design by contract.
I ISP
Interface segregation principle
“many client specific interfaces are better than one general purpose interface.”[5]
D DIP
Dependency inversion principle
one should “Depend upon Abstractions. Do not depend upon concretions.”[5]
Dependency injection is one method of following this principle.
No comments:
Post a Comment