Modules vs. Packages

Alex Buckley Alex.Buckley at Sun.COM
Fri Feb 6 02:35:18 EST 2009


Hi Paul,

Fair point about (not) reusing the annotation symbol, especially if we 
eventually think about annotating "requires" and "permits" clauses.

The module name/version separator can technically be any token except a 
comma, since the grammar uses comma to separate multiple module 
identities. I see how : would be great for Maven:

module com.foo.product : gui : 1.0 {
   requires com.bar.xmllib : domparser : 2.0;
}

OSGi versions are dot-delimited, so I don't see a conflict with : there. 
I do not know what Jigsaw is planning for versions, but I do recall Mark 
wanting more structure than a.b.c.d, so : could help there too.

Alex
(Transmitting live from Brussels)

Paul Benedict wrote:
> Alex,
> 
> I found the M at V notation to be a bit surprising. I get what it is
> trying to express -- "Module at/of Version" -- but I do not like
> reusing the annotation symbol here.
> 
> Joshua Bloch wrote in his latest "Effective Java" book that
> annotations, when first introduced, missed an opportunity to use the
> NAME:VALUE notation precedent. If that decision was made, it would be
> easy enough to expand the language for default parameter values too.
> Imagine this instead:
> 
> @SomeAnnotation(options:1)
> void draw(int x, int y, Color color:BLACK);
> 
> And let's not forget the foreach loop:
> for (String value : arrays)
> 
> Likewise, I think M:V would be better suited. Aside from some
> precedent already (foreach), it is a popular convention used by Maven
> (group:artifact:version).
> 
> Paul


More information about the jsr294-modularity-observer mailing list