Chapter 1. OSGi revealed

 

This chapter covers

  • Understanding Java’s built-in support for modularity
  • Introducing OSGi technology and how it improves Java modularity
  • Positioning OSGi with respect to other technologies

The Java platform is an unqualified success story. It’s used to develop applications for everything from small mobile devices to massive enterprise endeavors. This is a testament to its well-thought-out design and continued evolution. But this success has come in spite of the fact that Java doesn’t have explicit support for building modular systems beyond ordinary object-oriented data encapsulation.

What does this mean to you? If Java is a success despite its lack of advanced modularization support, then you may wonder if that absence is a problem. Most well-managed projects have to build up a repertoire of project-specific techniques to compensate for the lack of modularization in Java. These include the following:

  • Programming practices to capture logical structure
  • Tricks with multiple class loaders
  • Serialization between in-process components

But these techniques are inherently brittle and error prone because they aren’t enforceable via any compile-time or execution-time checks. The end result has detrimental impacts on multiple stages of an application’s lifecycle:

1.1. The what and why of OSGi

1.2. An architectural overview of OSGi

1.3. “Hello, world!” examples

1.4. Putting OSGi in context

1.5. Summary

sitemap