Common Reuse Principle

CRP:

The classes in a package are reused together. If you reuse one of the classes in a package, you reuse them all. (http://www.objectmentor.com/resources/articles/granularity.pdf)

It is a consequence of the ReuseReleaseEquivalencePrinciple which basically says that clients of a class will have compile, link, and/or testing dependencies on an entire package instead of just the classes it directly uses. What it means is that if a client relies on one class in a package then it should rely on all of them. It tries to push classes that aren't reused together into separate packages. -- PhilGoodwin


This is unrealistic in practice in my opinion, at least on the inter-app level. Granularity of variance can be very unpredictable. I prefer HelpersInsteadOfWrappers: abstractions that can be busted apart and reworked if needed for different applications or contexts. (This comment is meant to apply to custom applications. Systems software and other domains may have a different ChangePattern profile.)


One of the PrinciplesOfObjectOrientedDesign.


CategoryModelingLawsAndPrinciples


EditText of this page (last edited September 11, 2013) or FindPage with title or text search