There are some indicators that a package is out of control.  Any of the following can suggest that a package needs refactoring:

  • More than thirty or so classes.  Either create sub packages or split the package in two.

  • Unrelated classes that do different things.   For example, if you have some classes that relate to XML parsing and the rest relate to data transmission, the package could be split in two.

  • Inconsistent naming of files. If the package classes do not appear to relate to the name of the package, perhaps they need to be renamed or moved to a better package.

blog comments powered by Disqus