concept bundle dependency in category osgi

This is an excerpt from Manning's book OSGi in Action: Creating Modular Applications in Java.
What does the wiring in figure 2.16 tell you? It says that when the main bundle needs a class in package org.foo.shape, it gets it from the shape API bundle. It also says when the shape API bundle needs a class in package javax.swing, it gets it from the Swing bundle. Even though this example is simple, it’s largely what the framework tries to do when it resolves bundle dependencies.
If this is the case, then why choose one over the other? There’s no real reason or recommendation for doing so. These two concepts overlap for historical reasons. Dynamic imports have existed since the R2 release of the OSGi specification, whereas optional imports have only existed since the R4 release. Even though optional imports overlapped dynamic imports, they were added for consistency with bundle dependencies, which were also added in R4 and can also be declared as optional.
Figure 10.1. The OBR proposed specification provides a federated index that allows a management agent to resolve and install large numbers of bundles from a number of remote locations. The OBR index files are aggregated by a RepositoryAdmin service that resolves bundle dependencies on behalf of a management agent.
![]()