No deps on JAXP was: JDK support for VM to read classes from modules in a module library

Jaroslav Tulach jaroslav.tulach at oracle.com
Fri May 18 00:07:06 PDT 2012


Dne Čt 17. května 2012 13:57:17, Alan Bateman napsal(a):
> > package sun.misc;
> > public class XMLUtilsImpl implements XMLUtils {
> > 
> >   // call javax.xml.** methods
> > 
> > }
> > 
> > As Yarda's message pointed out, the same bridge module could deal with
> > XML-format Preferences, and you could supply a fallback implementation
> > based on something like NanoXML for use in small environments where
> > JAXP would be overkill.
> 
> This is nice in that it eliminates this optional dependency but it means
> we have another module to deal with. 

Welcome to the modular world. There is no need to be afraid of proliferation 
of modules if there is a way to track and manage their dependencies. There was 
a claim that re-use (e.g. finer granularity) complicates use[1] (as it is 
easier to depend on the whole monolithic piece), but with require service and 
provide service meta information these two forces can be balanced quite 
nicely[2].

In case of modularization of JDK I'd advocate focus on as easy re-use as 
possible. Not only it will turn JDK into set of flexible libraries, but it will 
also simplify the job for IDEs and javac. Why should anyone working on 
java.base module sources have to parse JAXP?

To give old schoolers equivalent "use" experience with JDK8 as they used to 
have with JDK7, I think it is enough to have one "JavaSE at 8.0" module with 
convenient dependencies which those guys can depend on. As far as I understand 
this is the Jigsaw plan, so balance between use and re-use should be there.

Should you agree that elimination of java.base => JAXP linkage dependency is 
reasonable goal and you just don't want to bother with it now, I'd be happy to 
try it myself and prepare a patch.
-jt 

[1] http://www.amazon.com/Java-Application-Architecture-Modularity-
Development/dp/0321247132/ref=ntt_at_ep_dpt_1
[2] http://wiki.apidesign.org/images/e/ec/Patterns_for_Modularity_II-
_Revenge_of_the_Patterns.pdf





More information about the jigsaw-dev mailing list