Eliminate silent dependencies

Jaroslav Tulach jaroslav.tulach at oracle.com
Wed Feb 22 08:11:49 PST 2012


> Jesse wrote:
> > is your suggestion to force the my.corp.app module to always have a
> > direct dependency on explicit implementation of a parser (e.g. saxon)?
> 
> Exactly. If Saxon works, why would you want the app to run with something
> else? 

Because you want somebody else to reuse my.corp.app in different environment. 
E.g. for reusable components want flexibility.

> > Otherwise others, reusing jaxp or my.corp.wsparser will find out
> > only during runtime that the execution environment is insufficient.
> 
> Yes, but compared to other problems this is a very simple one to solve -
> add the desired implementation. It would just be part of the documentation

Having (optional) type information in documentation rather than in source 
files is more common in languages like Ruby or JavaScript (with all drawbacks 
and benefits). As Alan wrotes...

>## Alan wrote on 22. 2. 2012 11:14:04 ##<
> Jigsaw is a static module system so it needs to know that 
> implementations of S that may be required at runtime so as to include 
> them in the configuration.

... this is Java and it is supposed to be "type safe" - e.g. if there is a way 
to prevent runtime errors at compile or install time, we should prevent them.

Being able to request (optional) presence of services in an execution 
environment is essential to modular usage of ServiceLoader and I think the 
current Jigsaw design goes in the right direction.
-jt



More information about the jigsaw-dev mailing list