Analytics Vidhya
Published in

Analytics Vidhya

Open-Closed principle

Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification

This principle advises us to refactor the system so that further changes are achieved by adding new code and, because it doesn’t change the old code, will not cause more modifications. Modules that conform to OCP have two primary attributes.

  1. They are open for extension. The behavior of the…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store