Java Application Architecture

Modularity Patterns with Examples Using OSGi

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.

Acyclic Relationships

For the full description, implementation variations, consequences, and detailed sample, see Page 150 in Java Application Architecture.
Statement
Module relationships should be uni-directional.
Description
When you define a relationship between two system modules, their coupling is increased. Some degree of  coupling is necessary simply because modules need to work together to accomplish some task. But certain types of coupling [...]

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 [...]

Chapter 8 – Reference Implementation

Thus far, we’ve spent the majority of Part 1 making the case for modularity. Before we delve too deeply into the patterns, let’s witness first-hand the benefits of a modular architecture.
8.1 – Why No OSGi?
The example that follows doesn’t use OSGi. One would think that if I’m going to modularize my system, I’d want to [...]

Chapter 6 – Realizing Reuse

Reuse is software development’s unattainable panacea. The ability to compose systems from reusable elements has long been our achille’s heel.  We want reuse so badly, yet our failures are spectacular. Almost all major technology trends of the past 20 years touts reuse as the saving grace. Vendors have sold billions of dollars in software through [...]

Chapter 5 – Taming the Beast

Modularity is not a new concept. In his 1972 paper titled, “On the Criteria to be used in Decomposing Systems Into Modules”, David Parnas cited the work of Gouthier and Pont as the first lucid statement of modular programming:
A well-defined segmentation of the project effort ensures system modularity. Each task forms a separate, distinct program [...]

Chapter 4 – Architecture and Modularity

Modularity plays an important role in software architecture. It fills a gap that has existed since we began develop enterprise software systems in Java. Here, we’ll discuss that gap and explore how modularity is an important intermediary technology that fills the gap.
4.1 – Defining Architecture
There are numerous definitions of architecture. But within each lies a [...]

Chapter 3 – The Two Facets of Modularity

There are two aspects to modularity – the runtime model and the development model. Today, emphasis is on the runtime model, with frameworks emerging that provide runtime support for modularity. But eventually, as the runtime model gains adoption, the importance of the development model will take center stage. The patterns in this book focus on [...]