Back to basics: SOLID – Open/Closed Principle (OCP)

Published on

Sep 15, 2016

SOLID: Open/Closed Principle (OCP)

Last week we've talked about "What are SOLID principles?", because we all like good code and nice architectures. But respectability does not come with a single practice, and SOLID counts six letters: six ways of being a better programmer! So, now that you understand well the SRP (check out previous SOLID article if you don't know what's the SRP), here comes the second letter.

"O" for OCP

Open/Closed principle is here to allow your classes to be both flexible and protective from bad extends statements. SOLID: Open/Closed Principle (OCP)

All the SOLID articles on KNPLabs:

Written by

KNP Labs
KNP Labs

Comments