A design pattern is a reusable element of software architecture that can be applied to different situations. This section presents the two most common OSGi-specific patterns: whiteboard and extender.
The OSGi whiteboard pattern is one in which updates are communicated by bundles to a central location. This approach can be compared to that of a shared whiteboard where someone updates an entry on the whiteboard and others can come and have a look at it, without needing any direct connection or coupling between them, as illustrated in the following diagram:
Provided that the individual has a reference to the shared whiteboard, they can add notes to it. This allows others to pick up the message without having any direct relationship with the individual who created it:
The OSGi Service Registry and OSGi Event Admin (covered in Chapter 8, Event-driven Applications with EventAdmin) are both examples of the whiteboard pattern. Here, bundles talk to the shared service...