>
> > So there's no reason the module system itself couldn't just discard
> > "friend" status for any friend API and allow any module to depend on it,
> > where the running release version is >= the first-appeared-in-release + 2
> > (or whatever number).  So, a friend API that appears in release 9 is
> > automatically a public API in release 11, no human intervention required
> > (the Ant build harness and Maven plugin would also have to do this
> > computation).
> >
>
> I still don't see why this isn't looking at the problem backwards. True
> friend APIs and not-yet-stable public APIs seem to be orthogonal problems.
>

I was there when friend APIs were being invented.  The *entire* purpose was
for a developer to evolve an API, in collaboration with others whose
requirements might lead to incompatible changes in it, prior to being
subject to the stringent backward compatibility requirements Sun required
of public APIs.

IMO, there *is no such thing as a "true friend" API.*  If you don't want to
publish an API, put all of your code in one module - the compatibility
contract is between that module and itself.  If module X depends on module
Y, and nothing else may depend on Y, and X cannot function without Y, then
you have *a single logical module.*  You might think it looks nicer carved
up into two pieces, but at that point you're doing code feng shui, not
engineering.

Assuming even non-stable APIs are stable for at least one release of the
> IDE / platform, what benefit does this actually provide? Surely it is for
> the user of the API to specify a non-stable dependency, not the provider to
> act as gatekeeper?
>

The logical outcome of friend APIs is nobody creates anything else, unless
there is a mechanism that says "stabilize your API or you're going to have
to keep binary compatibility with whatever you've got when the clock runs
out."  The ongoing growth of stable APIs is what moves the platform and IDE
forward, allowing new functionality to stand on the shoulders of what is
already there.  Friend APIs keep that from happening.

If you have "non-stable dependencies", eventually that is all that will
exist.  Nobody would prefer to keep compatibility if they don't have to.

-Tim

Reply via email to