Module Views

David M. Lloyd david.lloyd at redhat.com
Wed Dec 7 18:54:28 PST 2011


On 12/07/2011 03:17 PM, mark.reinhold at oracle.com wrote:
> Applying these two kinds of transformations to the current prototype
> build reduces the overall module count from 63 to 45.
>
> Open issues
> -----------
>
>    - How do views map to native packaging systems such as RPM or Debian?
>      Treating a module view as a virtual package would probably work but
>      might not scale well.  Another possibility is to structure the names
>      of non-default views so that they always include the names of their
>      containing modules, but that turns views into second-class entities.

These cracks speak to an underlying flaw.  It boils down to one 
question: how do you locate your module views?  We can load modules O(1) 
from a known point on the file system if only we know the name of the 
module and the filesystem is structured accordingly.

If you're using views to define "also known as" then the only way to 
know what modules are available on the system with this approach is to 
read every module descriptor.  You could optimize this by using a global 
index, but frankly this would really suck, and should not be necessary; 
a user should never need to do any more than drop a file or files in the 
filesystem at the right spot to install a module.

Making views always be subordinate to the module name is the only way to 
make this work reasonably IMO.  But anyway at this point you could just 
as easily use a general alias concept to solve the same problem.

It is my opinion that Jigsaw doesn't need more concepts - it arguably 
has too many already.  Even in working with JBoss Modules (which is 
simpler than Jigsaw in many ways), I've had to do quite a lot of 
education to bring people up to speed on the modular way of thinking.  I 
can't imagine justifying adding a new concept like this when you could 
use a more general, simpler to understand concept like module aliases 
instead.  "This module is another name for that one" is about as easy to 
understand as you can get.  Adding a simple override ability to this for 
the main class is trivial.

> History and status
> ------------------
>
> Module views are not a new idea.  The concept proposed here is very
> similar to that of _structures_ in the module systems of [Scheme 48][3]
> and [Standard ML][4].
>
> Jon and Mandy are working to extend the Jigsaw prototype to support
> views, and Alex is drafting new language and class-file specification
> text.  All of this material will be published shortly.

-- 
- DML



More information about the jigsaw-dev mailing list