Java Reference
In-Depth Information
A refined approach
The best strategy devised so far is to shift the burden to the consumer. This is pretty
straightforward and requires implementers to specify a version range of [1.0,1.1) ,
while users can specify the broader version range of [1.0,2.0) as shown in the fol-
lowing figure.
Uses
version="[1.0,2.0)"
org.foo
Implements
version="[1.0,1.1)"
Another important requirement for versioning is consistency. You don't want to
define your versioning policy on a bundle-by-bundle basis. So, whether you follow the
recommended approach or not, you should at least try to use the same policy globally.
This gives you a fairly good understanding of versioning policy for packages, but
what about versioning bundles? We'll explore bundle-versioning policies next.
9.1.3
Bundle versioning
Bundles and packages are related through containment: bundles contain packages.
Because both bundles and packages have version numbers, what is the relationship
between them? You need to adopt a versioning policy to define this relationship. Let's
look at that in more detail.
In the simple case, a bundle may contain several related implementation packages,
all with the same version number. Here it's advisable to make the bundle version mir-
ror the version of the implementation packages. When you're dealing with a bundle
containing packages of different versions, the most consistent versioning policy is to
increment the bundle version based on the highest change of a package inside it. For
example, if any package has a major number increase, the major number of the bun-
dle should increase as well; the same is true if the highest change was to a minor or
micro portion of the version. With this policy, it's possible to judge the impact of an
updated bundle based on its version number. Unfortunately, this may not always make
sense, especially if the versions of the individual packages represent a well-known
product version.
For example, let's assume you want to create a bundle for the core API of the OSG i
framework. In this case, you have several independently versioned packages, but the
 
Search WWH ::




Custom Search