Packages
What are packages?
- Packages are help provide modularity.
- Related classes can be grouped together in packages.
- Packages may share data (friendly access mode).
- Interfaces can be used to define standard set of methods for a package.
- Packages are a good way to distribute programming environments.
Why Modularity?
- Complexity of programs tends to grow exponentially with length.
- The effort expended programming tends to grow exponentially with length.
- The useful output of programs grows sublinearly.
- Maintanance of a worthwhile program costs many times the initial production cost.
- Modularity isolates different portions of the task.
- The "interface" (not in the Java sense) between modules should be small.
- The "interface" is the public variables and public methods.
Hence:
- Modularity tends to make programming task grow more linearly.
- Modualrity makes programs more maintainable.
J. Anthony Parker, MD, PhD, Tony_Parker@bih.harvard.edu