On Feb 23, 7:33 pm, Reinier Zwitserloot <[email protected]> wrote:
> I don't think you can just evolve incompatible APIs because you have a
> module system, Alex.

What is the point of versioning in a module system if not to allow
multiple INcompatible versions to co-exist? (That doesn't require
every upgrade to introduce an incompatibility, only that a versioning
scheme describes when and how compatibility can be affected.)

> Let's say we add a 'filter' method to list. How? We can only change
> List if we add List to the versioned set. But if we do that, then any
> two modules that require different versions can no longer talk to each
> other if the talk protocol involves Lists, which are almost as 'near-
> primitive' as Strings. That's not going to fly. You still need a way
> for an old 'view' on Lists, or for two separate List libraries to be
> able to hand each other wrappers or some other solution to cross this
> bridge.

Of course java.util.List is in a versioned module. Every piece of code
you ever write is versioned, whether you write down the version or
not. Two modules that require disjoint versions of List cannot pass
Lists between themselves, but that is likely to be rare. What is far
more likely for core JDK classes is that we will promise to evolve
them in a way that is a) binary-compatible, b) behavior-compatible,
and c) not source-compatible. In other words, we will add methods to
List but (probably) not redefine existing methods. Again, this is what
a versioning scheme is for. Putting it all together, a module which
requires version >=7 of List and a module which requires version >=8
of List (since the module uses List.filter) can both get version 9 of
List and cooperate at runtime.

> Or you use extension methods and you don't have this problem.
>
> NB: If you want a full proposal, it's very simple:

Few things in the Java language are as simple as they seem.

Alex
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to