专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »博文摘选 » 面向对象:闭锁性共通原则(CCP) »正文

面向对象:闭锁性共通原则(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 )。   
    闭锁性共通原则(CCP):The Common Closure Principle 。是为了解决包设计的凝集问题的。

    包中的所有类对于同一类性质的变化应该是共通封闭的。一个变化若对一个包产生影响,则将对该包中的所有类产生影响,而对于其他的包不造成任何影响 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

相关文章

读者评论

发表评论

  • 昵称:
  • 内容: