the basic object-oriented open-closed principle:
The open-closed principle states that a software module should be:
Open for extension — It should be possible to alter the behavior. of a module or add
new features to the module functionality.
Closed for modification — Such a module should not allow its code to be modified.
In a nutshell, the open-closed principle helps in designing software modules whose
functionality can be extended without having to modify the existing code.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16792402/viewspace-582239/
,如需转载,请注明出处,否则将追究法律责任。