David M. Lloyd
david.lloyd at redhat.com
Mon Aug 10 14:16:42 EDT 2009
On 08/10/2009 12:24 PM, Alex Buckley wrote:
> Peter Kriens wrote:
>> I've tried hard to distinguish between "namespace" modules and
>> "deployment" modules. As you can see this gives "module" two meanings.
>> To distinguish between these two cases, I decided to use container for
>> a deployment module, if there are better names, let me know.
>> Namespace modules are basically like packages, but making module
>> membership hierarchical. This is a very natural model that I think is
>> instantly recognized by all Java programmers. Containers are having
>> dependencies and membership is based on containment in a physical
>> artifact, allowing the membership (and visibility) to be defined in a
>> packaging step.
>> Unfortunately, 294 never had a crisp definition of a module so it is
>> hard to describe a delta ...
> I'm sorry but you're wrong. I defined a module for this JSR in January:
> "A module is a named set of packages that a) defines an encapsulation
> boundary for its member types, b) describes its relationships with other
> named modules, and c) enforces both encapsulation and relationships at
> compile-time and runtime. A module is identified by a name and
> optionally a version."
> The whole point was to introduce a single concept for both accessibility
> and visibility. I understand you want two concepts, which would be more
> expressive, but also more complicated as I outlined in mails up-thread.
I'm probably missing something here, but why not simply broaden
package-private access to be module-private, with an equivalent change to
protected? Then require that all modules' packages are "sealed" to avoid
the split-package problem - or just ignore it and consider the in-module
rules to be separate. Packages outside of modules would conform to the old
rules. Problem solved, no language-level changes needed, no learning curve.
I leave relationships & versioning to greater minds than mine, except to
say that if you find a versioning scheme or methodology that works for
everyone, I will be impressed indeed.
More information about the jsr294-modularity-observer