What is the meaning and reasoning behind the Open/Closed Principle?

后端 未结 14 1195
死守一世寂寞
死守一世寂寞 2020-12-02 08:31

The Open/Closed Principle states that software entities (classes, modules, etc.) should be open for extension, but closed for modification. What does this mean, and why is i

14条回答
  •  半阙折子戏
    2020-12-02 08:59

    I just want to emphasize that "Open/Closed", even though being obviously useful in OO programming, is a healthy method to use in all aspects of development. For instance, in my own experience it's a great painkiller to use "Open/Closed" as much as possible when working with plain C.

    /Robert

提交回复
热议问题