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

后端 未结 14 1185
死守一世寂寞
死守一世寂寞 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 09:00

    There are two versions of the Open Closed Principle.

    See the following for a clear and thorough explanation of both: https://www.slideshare.net/pjschwarz/first-expedia-tech-know-how-event-the-openclosed-principle-the-original-version-and-the-contemporary-version

    To whet your appetite, here are screenshots of the first few slides:

提交回复
热议问题