Chapter 3. The auction application: an OSGi case study

 

This chapter covers

  • Modularization and extension as application requirements
  • Service properties
  • Development of a full-fledged OSGi application consisting of several decoupled bundles

Having explored the concepts behind development platforms in chapter 1 and working through the OSGi framework primer in chapter 2, we’re ready to implement our first unabridged OSGi application: an auction system where buyers and sellers can trade goods through bids and ask offers.

The chapter starts by describing the auction use case. We’ll consider a traditional approach for implementing the use case and investigate its shortcomings. We’ll then look at a solution using OSGi where we develop a modular and extensible solution, thus improving maintainability. We’ll prove its modularity by easily replacing the initial test bidder with a web-based bidder, and we’ll make use of its extensibility to allow different brokering strategies to be developed as plug-ins.

Finally, we’ll determine what’s missing from the auction application to make it into a full-fledged enterprise-grade application, and we’ll highlight how this can be achieved using standard OSGi services.

We’ll start, as is usual in the development of any software, by establishing the requirements of the system.

3.1. Establishing the requirements for an auction system

3.2. Modularization and extensibility as application requirements

3.3. Defining the interfaces

3.4. Defining the extension points

3.5. Putting it all together

3.6. The OSGi HTTP service

3.7. Improving the auction application to enterprise grade

3.8. Summary