Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipse-pmc] Publishing 0.9 API's for new components

> My gut feeling is that you want x-internal:=true so that clients don't call
> internals inadvertently.  We could solve the warnings problem with a
> modifier on Require-Bundle/Import-Package, something like: "Require-Bundle:
> org.eclipse.equinox.p2;forced-friend:=true" - what do you think?

> Boris

Interesting idea.  But I think it has some drawbacks.  I would be more in
favor of using selective x-friends to "known" consumers.  I realize that
it is not always possible to know all your potential friends.  But at
least this gives the developer of the package some idea of who is
using the "provisional" package before it becomes API.  As an
implementation detail, the way x-internal packages are implemented
today would need significant changes to add a forced-friends option.
When running in "strict" mode at the framework level we completely
remove all the x-internal packages from a bundle's export list.  This
will prevent any importer/requirer from accessing the internal package.

If we were to pursue such an enhancement I would prefer the exporter
to make some explicit declaration that importers can force-friendship.
Something like the following maybe:

Bundle-SymbolicName: foo
Export-Package:; x-friends:="ALLOW-FORCED-FRIENDS"

Then to import/require:

Import-Package:; x-forced-friends:=true
Require-Bundle: foo; x-forced-friends:=true

This way it is an explicit decision by both the producer and the
consumer of the package to allow use of an internal package.

Oh wow, I just realized this is the PMC list.  Not sure technical
discussions like this belong here, but I already spent the time
to write this out so I'm sending it anyway ;-)

Boris, please open a bug against Equinox-Framework if you want
to continue this discussion for enhancement.


Back to the top