Java Application Architecture

Modularity Patterns with Examples Using OSGi

Category: Base Pattern

Cohesive Modules

For the full description, implementation variations, consequences, and detailed sample, see Page 150 in Java Application Architecture.
Statement
Module behavior should serve a singular purpose.
Description
There are two key elements that affect module cohesion. These follow:

The rate at which the software entities within a module change.
The likelihood that the software entities within a module are reused together.

Based on [...]

Module Reuse

For the full description, implementation variations, consequences, and detailed sample, see Page 150 in Java Application Architecture.
Statement
Emphasize reuse at the module level.
Description
One of the oft cited benefits of object oriented development is reuse. A large part of its failure is because classes aren’t the best reuse mechanism.

Manage Relationships

For the full description, implementation variations, consequences, and detailed sample, see Page 150 in Java Application Architecture.
Statement
Design module relationships.
Description
A relationship between two modules exists when a class within one module imports at least a single class within another module. In other words:
If changing the contents of a module, M2, may impact the contents of another [...]