面向对象:闭锁性共通原则(CCP)来源: 发布时间:星期三, 2009年9月30日 浏览:0次 评论:0
转载自:http://blog.csdn.net/hantiannan/archive/2009/09/30/4622913.aspx
介绍一下RobertC.Martin提出的面向对象的设计原则中的闭锁性共通原则。参考文档(http://www.objectmentor.com/resources/articles/Principles_and_Patterns.pdf
)。 包中的所有类对于同一类性质的变化应该是共通封闭的。一个变化若对一个包产生影响,则将对该包中的所有类产生影响,而对于其他的包不造成任何影响 ( The classes in a package should be closed together against the same kinds of changes. a change that affects a package affects all the classes in that package. )。 还有就是因为同一类性质的变化而被修改的类应该放在同一个包内 (Classes that change together, belong together. )。 0
相关文章读者评论发表评论 |
|