CSC/ECE 517 Fall 2009/wiki3 3 cp: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 5: Line 5:
According to [http://www.objectmentor.com/omTeam/martin_r.html Robert Martin] the definition of Common Closure Principle is that   
According to [http://www.objectmentor.com/omTeam/martin_r.html Robert Martin] the definition of Common Closure Principle is that   


       Classes within a released component should share common closure. That
       THE CLASSES IN A PACKAGE SHOULD BE CLOSED TOGETHER AGAINTS THE SAME
       is, if one needs to be changed, they all are likely to need to be
      KINDS OF CHANGES. A CHANGE THAT AFFECTS A PACKAGE AFFECTS ALL THE
       changed. What affects one, affects all.
       CLASSES WITHIN THAT PACKAGE.
       See [http://www.objectmentor.com/resources/articles/granularity.pdf
      Granularity PDF Article] written by Robert Martin for more details


In other words, '''what affects one, affects all''' broader and detailed explanations are given in this wikiwork.
In other words, '''what affects one, affects all''' broader and detailed explanations are given in this wikiwork.

Revision as of 03:50, 18 November 2009

Common Closure Principle

In simple words the Common Closure Principle refers to classes that change topether, belong together, this is a very simple definition taken from the book Java Design: Objects, UML and Process written by Kirk Knoernschild.

According to Robert Martin the definition of Common Closure Principle is that

      THE CLASSES IN A PACKAGE SHOULD BE CLOSED TOGETHER AGAINTS THE SAME 
      KINDS OF CHANGES. A CHANGE THAT AFFECTS A PACKAGE AFFECTS ALL THE 
      CLASSES WITHIN THAT PACKAGE. 
      See [http://www.objectmentor.com/resources/articles/granularity.pdf 
      Granularity PDF Article] written by Robert Martin for more details

In other words, what affects one, affects all broader and detailed explanations are given in this wikiwork.

Introduction and Objective

According to Robert Martin the definition of Common Closure Principle is that

"Classes within a released component should share common closure. That is, if one needs to be changed, they all are likely to need to be changed. What affects one, affects all."

How to Implement Common Closure Principle ?

Java Example

Ruby Example

What are the advantages and disadvantages?

Reading Recommendations

Reference Books

External Links

Bob Martin's

Appendix