What are The SOLID principles of Object Orientated design? Well, 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 SOLID principles of Object Orientated design are:
S – Single Responsibility Principle
Firstly, an object should have a single responsibility.
O – Open / Closed principle
Secondly, an object should be open for extension but closed for modification.
L – Liskov substitution principle
Thirdly, objects in an application should be replaceable with instances of their subtypes without altering the correctness of that program.
I – Interface segregation principle
Next, many client-specific interfaces are better than one general-purpose interface.
D – Dependency inversion principle
Finally, one should depend upon abstractions and not concrete instances.
So, there you have it. Now you know the SOLID principles of Object Orientated design.
Want to know more? This Free Code Camp article might help.