HeavyWeight

From APIDesign

Jump to: navigation, search

How one defines a weight of a module? In general it is a size of its environment - which is usually expressed by the outgoing dependencies the module has.

If there is a module depending on Swing, it is more HeavyWeight than a module which depends only on ArrayList - because the first one requires whole JDK8 while the latter can run on JDK8 compact 1 profile (which is not just a matter of the name but also of about 30MB of download size and other resources).

The classic refactoring is to increase granularity of your modules - e.g. split them into (two) parts. Module A (shows a dialog, asks for a number and shows result) can be refactored into two modules: one library to compute the factorial and another JAR to show the dialogs and call into the library to get the right results.

Personal tools
buy