On 7/27/09 8:24 AM, David Savage wrote:
On Fri, Jul 24, 2009 at 11:23 PM, Richard S. Hall<[email protected]> wrote:
On 7/24/09 12:35 PM, David Savage wrote:
To lay my cards on the table, I kinda like resolve=compile as it dove
tails kinda neatly with resolution=optional, but equally it seems
kinda bizarre to be adding another dimension to this whole problem
when people are worried about the complexity of OSGi. If there is a
way to do this without exposing developers to it that would be /great/
but as with OSGi I don't think we should worry about doing the right
thing at the base layer IDE tools and other schemes can always
simpilify this whole space down again to joe blogs. I guess it's a
question of what is "right".
So I guess the end result of this email is, what are your thoughts?
* Is resolve=compile a good idea?
* Should it be resolution=compile?
* Any other options?
Isn't this some form of "uses" constraint? Middle exposes Top because it
inherits from it, so if you follow transitive "uses" constraints you could
possibly assume that compile-time access is needed.
Hmmm you're right it certainly resembles uses - should have spotted
that myself. However I have a feeling it may get a bit hairy in
certain edge cases, i.e. Top may not be in an exported package which
could work at runtime I believe, as Middle would provide the class
path to Top?
I agree, it might not work in every case, but it seems like a good place
to start. It seems in the general case, if a type is exposed, then
someone must have a dependency on it or contain it somewhere in the
transitive set of dependencies, otherwise it couldn't be exposed...
* What to do about fragments?
I don't think the fragment issue should be handled, since that is a bogus
use case for fragments from my point of view. Fragments are intended to be
optional extensions to the host, but in this case the host is fibbing about
its contents because it expects to have a fragment attached to it. In
reality, the fragment should have the exports, not the host.
Tend to agree it is a bogus scenario - if only it wasn't happening in
one of the most used OSGi libraries available :( I guess Eclipse
probably have a good reason for doing this - not sure what but I'll
give them the benefit of the doubt.
Regardless, it doesn't seem like a good idea to create whole new
mechanisms to support improper use cases.
-> richard
I think I've figured out a way to work around it for the time being -
which takes the pressure off from a sigil release point of view. I'll
add the fragment to the ordinary classpath vs the OSGi filtered one,
so I can at least compile against it without dragging in an external
dependency at runtime. The danger with this approach is that unwary
developers may link against a non exported package by mistake. Just
wonder if there is a way to make this work without complicating the
development model (or the sigil code) too much...
-> richard
* Is anyone still there (i.e. has this email lost you all?)?
Regards,
Dave