TITLE: Design Principle 6 - unit of release AUTHOR: rmartin@rcmcon.com (Robert Martin), 11 Aug 95 -------------------------------------------------------------------- 6. Classes within a released component should be reused together. That is, it is impossible to separate the components from each other in order to reuse less than the total. -------------------------------------------------------------------- When a user decides to reuse a component, he creates a dependency upon the whole component. When a new release of that component is created, the user must reintroduce that new release into his existing applications. Therefore, the user will want each component to be as focused as possible. If the component contains classes which the user does not make use of, then the user may be placed in the position of accepting the burden of a new release which does not affect any of the classes within the component that he is using. Thus, comoponents should be kept relatively narrow. If the user uses one of the classes in the component, then it should be extremely likely that he should reuse all the other classes in the component. Generally, this kind of focus is enforced by the relationships that exist between classes that are reused together. Those relatioships represent dependencies that force the user to bring along all the classes within a component. It is important that dependencies that are associated with reuse be encapsulated within a single component where possible. If the reuse of a particular class within a component forces the reuse of other components, then the user has a bigger reuse burden.