202204272242 Open-closed
The open/closed principle of the 202204272244 SOLID design principles for software development, which states:
Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification1
This means that we should be able to extend the behavior without modifying its source code. For example, in the case of classes and inheritance, sub-classes can extend the behavior of a base class by implementing methods without changing the code of the base class. The base class is thus open for extension, but closed to modification.
-
Wikipedia contributors. (2022). SOLID. In Wikipedia. https://en.wikipedia.org/w/index.php?title=SOLID&oldid=1069309351 ↩