Software entities (e.g. classes) should be open for extension, but closed for modification. I.e. such an entity can allow its behavior to be modified without altering its source code.
- Write classes that can be extended (as opposed to classes that can be modified).
- Expose only the moving parts that need to change, hide everything else.
Top comments (0)