It's not always easy to step back from your Java package and see what it looks like from the outside, from another programmer's perspective.

So take a serious look at all the classes in a package.  If one or more classes are already being reused elsewhere, probably all the classes in that package should be (or will be) reused.  

If some of the other classes in the package are not appropriate for reuse, they should be moved to a different package.

This rule is a good way to review your packages, but there are some free automated tools to do this for you, like Checkstyle.  

blog comments powered by Disqus