Common Closure Principle

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. (

One of the PrinciplesOfObjectOrientedDesign.

This is the way Robert Martin puts it. I am tempted to say that it's the other way around -- classes that share common closure should be found in the same released component. The difference is that, while all classes that share closure are found in the same component, an individual pair of classes within a component aren't constrained to share closure with each other. The CommonReusePrinciple gives us a reason to collect groups of classes that don't share physical closure with each other into the same component.

This principle tries to pull classes that are tightly coupled to each other together into the same package.

I think the point is that unless your classes are tightly coupled, they shouldn't be in the same component (maybe because this prevents reuse).

Wasn't this just known as cohesion?


View edit of September 11, 2013 or FindPage with title or text search