Chapter 2. Mastering modularity


This chapter covers
  • Understanding modularity and why it’s desirable
  • Using metadata to describe OSGi bundles (aka modules)
  • Explaining how bundle metadata is used to manage code visibility
  • Illustrating how bundles are used to create an application


In the previous chapter, we took a whistle-stop tour of the OSGi landscape. We made a number of observations about how standard Java is broken with respect to modularity and gave you examples where OSGi can help. We also introduced you to some OSGi concepts, including the core layers of the OSGi framework: module, life-cycle, and service.

In this chapter, we’ll deal specifically with the module layer, because its features are the initial attraction for most Java ...

Get OSGi in Action: Creating Modular Applications in Java now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.