Java Reference
In-Depth Information
2.6
Finalizing the paint program design
So far, you've defined three bundles for the paint program: a shape API bundle, a
shape implementation bundle, and a main paint program bundle. Let's look at the
complete metadata for each. The shape API bundle is described by the following man-
ifest metadata:
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.shape
Bundle-Version: 2.0.0
Bundle-Name: Paint API
Import-Package: javax.swing
Export-Package: org.foo.shape; version="2.0.0"
The bundle containing the shape implementations is described by the following man-
ifest metadata:
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.shape.impl
Bundle-Version: 2.0.0
Bundle-Name: Simple Shape Implementations
Import-Package: javax.swing, org.foo.shape; version="2.0.0"
Export-Package: org.foo.shape.impl; version="2.0.0"
And the main paint program bundle is described by the following manifest metadata:
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.paint
Bundle-Version: 2.0.0
Bundle-Name: Simple Paint Program
Import-Package: javax.swing, org.foo.shape; org.foo.shape.impl;
version="2.0.0"
As you can see in figure 2.13, these three bundles directly mirror the logical package
structure of the paint program.
This approach is reasonable, but can it be improved? To some degree, you can
answer this question only if you know more about the intended uses of the paint pro-
gram; but let's look more closely at it anyway.
import
org.foo.shape
Shape
API
export
org.foo.shape
Paint
Shape
impl
import
org.foo.shape.impl
export
org.foo.shape.impl
import
org.foo.shape
Figure 2.13 Structure of the paint program's bundles
Search WWH ::




Custom Search