Proposal: #CompileTimeDependences: `requires static`
Nicolai Parlog
nipa at codefx.org
Sat Jul 2 23:02:03 UTC 2016
Hi Sander,
I think qualifiers to "exports" and "requires" would be nice but new
terms (instead of the proposed "exports dynamic" and "requires
static") might fix the problem as well (maybe even better) and should
hence be considered. A discussion going down this route could be
worthwhile.
My proposal was a strawman, shot from the hip, so I'm not going to
defend it much. :) But I want to clarify my intent.
"consumes" was proposed to replace "requires static". The rationale
being, that "requires" obviously says "I need this" while "consumes"
sounds much more relaxed: "I'll use it if it's there", which is
precisely what we want. Your argument regarding services is absolutely
valid, though.
Similarly "contains" was supposed to replace "exports dynamic". Two
things:
(a) "exports x.y.z" basically reads as "exports package x.y.z"
(b) to the outside world packages that are not mentioned in
module-info.java might as well not even exist.
So I thought that "contains" would say something like "Look, this
package is here; I'm not exporting it but if you find a way around
that limitation, be my guest to use it".
So I do not think that this clashes with "conceals".
What do you think?
Nicolai
On 01.07.2016 10:41, Sander Mak wrote:
>>> requires & consumes exports & contains
>>
>> So it would look as follows:
>>
>> module com.xyz { requires guava; requires joda; consumes
>> hibernate; exports com.xyz.a; exports com.xyz.b; contains
>> com.xyz.c; }
>>
>
> Going down this route, I would avoid 'consumes' since IMO it
> appears to be the inverse of 'provides' used with services. Also,
> the the proposed 'contains' seems to be equivalent to what is now
> called 'conceals' (when looking at output of for example `java
> -listmods:java.base`), which I find to be more descriptive. Or did
> you mean that 'contains' replaces 'exports dynamic'? In that case,
> I don't really see how that's any clearer.
>
>
> Sander
>
>
>
--
PGP Key:
http://keys.gnupg.net/pks/lookup?op=vindex&search=0xCA3BAD2E9CCCD509
Web:
http://codefx.org
a blog about software development
http://do-foss.de
Free and Open Source Software for the City of Dortmund
Twitter:
https://twitter.com/nipafx
More information about the jpms-spec-observers
mailing list