January 8, 2014
The SOLID principles of Object Orientated design
The 5 basic principles of OO design were put together in the early 2000s by Michael Feathers and Robert C Martin. They are intended to allow the developer to create software that is easy to maintain and extend over time. The patterns which have come out of these principles are usually easy to test and lower the total cost of ownership over the lifetime of the project.
They are also used in interview questions a lot and as such I have included them in their own section.
The principles are:
S – Single Responsibility Principle
An object should have a single responsibility.
O – Open / Closed principle
An object should be open for extension but closed for modification.
L – Liskov substitution principle
Objects in an application should be replaceable with instances of their subtypes without altering the correctness of that program.
I – Interface segregation principle
Many client specific interfaces are better than one general purpose interface.
D – Dependency inversion principle
One should depend upon abstractions and not concrete instances.