On 10.06.2011 23:39, mvangeert...@comcast.net wrote:
> Do you feel that embedding all of a file's dependencies into a bundle
> is the right approach?  I think it contravenes some of the core
> principles of OSGi to embed dependencies except in some rare
> corner-cases.

I'm not Justin, but..

Yes and no. :) Not every random jar can, must or should be shared and
turned into a bundle, and while it is obviously wasteful to embed the same
dependency over and over again, what matters is:

a) it helps to get somewhere for implementing the primary bundle
b) it reduces unnecessary bundle inflation & class space poisoning
c) it is *safely* *possible* to clean up later in an incremental fashion

The keywords here being safely and possible.

Many libraries have static state and need manual cleanup, either
periodically or governed by the using service bundle's lifecycle. Some
might even need per-bundle bytecode manipulation ("fixes"). This is a sad
reality of the Java ecosystem and pretending that all developers will
suddenly support OSGi and/or write properly shareable code is at best
naive. Hell, the majority of devs don't even understand their own code!
This fallacy is exactly why some people even claim that OSGi is
"impractical" because you have to "fix the world". Bullshit.

Share the good parts, safely isolate the crap, iteratively clean up. Your
bundles are too fat? Maybe don't stuff so much garbage into your project.

For what it's worth: just because a bundle is large on disk doesn't mean
it will actually use a lot of its classes; very often cross-artifact
dependencies have very low cardinality. Extending the bundle-plugin with
built-in stripping of unneeded classes from embedded artifacts would go a
long way towards reducing this accidental bloat.

-h

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to