August 2018
Intermediate to advanced
372 pages
9h 29m
English
The OCP is simple to write, but difficult to explain. For this reason, I'll write the following definition first and describe it later:
New features can be added to an existing module by extension and not by modification.
It sounds simple, doesn't it? In order to understand this concept from a practical viewpoint, it is necessary to revisit our last example. Let's check that we are accomplishing this principle by answering the following questions:
We need to write a new class (module), and this should implement an existing interface. Note how the open-closed principle makes sense with the provided answer. To support a new notification channel ...
Read now
Unlock full access