I think I was not too clear below.  I didn't mean to say that I am in
favor of Require-Bundle because it is a lot harder to come up with the
right Import-Package lists.  What I meant was that the reason why a
lot of people are using Require-Bundle like David mentioned in his
early notes is probably because it is a lot easier to use.

I personally had to spend quite some time to figure out the prob I
mentioned earlier  - I was developing a bundle that needs to import
the javax.transaction package from the transaction in OSGi bundle, but
two bundles have it (the basic OSGi J2SE and the transaction in OSGi
bundle).    I was able to resolve this using Import-Package with the
specific version of javax.transaction package that I need.  I just
tried to switch to use Require-Bundle, that is to have my bundle to
depend on the transaction in OSGi bundle as it contains the right
version of the javax.transaction package I need, but my bundle is
broken completely due to CDNFE.   I don't think the Require-Bundle
offers the fine grain control that I needed for my bundle and I am
sure Geronimo would have a lot more complicated bundles than what I
was developing.

BTW, there's a good discussion here:
http://thhal.blogspot.com/2008/02/dependencies-and-package-imports.html

- in particular in the first comment from Neil Bartlett and the
limitations of Require-Bundle documented in the OSGi v 4.1 core spec
(section 3.13.3).

Lin


On Thu, Mar 12, 2009 at 11:40 PM, Lin Sun <linsun....@gmail.com> wrote:

> Not sure about Require-Bundle.  I personally has never used it and I
> never see it is being used in the OSGi repo.  Require-Bundle may not
> offer the level of control that the Import-Package provides but it is
> probably a lot harder to come up with the right Import-Package lists.
>  I think this scenario should work just fine if using Import-Package.
>

Reply via email to