Optional service dependencies only was: Direct dependency on service provider modules?

Jaroslav Tulach jaroslav.tulach at oracle.com
Thu Jun 21 02:35:10 PDT 2012


Hello Paul,
here is my initial proposal for improving the dependencies mechanism to 
eliminate the NP-Completeness:

[1] http://wiki.apidesign.org/wiki/JigsawServices

Dne Čt 21. června 2012 10:05:27, Jaroslav Tulach napsal(a):
> > I would very like to do a mind meld with you on this!
> > 
> > It's interesting in that, with the current Resolver implementation, when
> > you push service provider module dependency resolution to the end then
> > there is no longer any backtracking above those dependencies, since they
> > are optional.
> 
> Are they really optional? What is optional on "requires service xyz"? But...

As the first part of [1] argues, with "requires service" you always need 
backtracking.

> Heuréka! I think I know how to overcome the NP-complete problem with
> services. We need to make sure we make the dependencies optional. E.g.
> there are no NP- complete problems with "requires service optional xyz".
> Thus, if we allow only optional services, we simplify everything a lot.
> 
> Of course, some "requires service" are not that optional. So the question
> for me is: how to make the dependency system usable and still pretend all
> services are in fact optional?

[1] talks about a "hint". I'd rather leave the exact language construct for 
providing a hint up to language experts, but I can imagine it makes a logical 
sense for the language. When I am JAXP module at 1.33 I probably want to 
recommend Xerces from JDK 1.33 as well. I should have a way to provide such 
hint to the Jigsaw resolution system.

However there should be a way to reconfigure these hints at the deployment 
time. I've noticed a discussion about security providers. You were in need of 
changing their order and that could be also considered a "hint". Just probably 
a hint provided externally, at the time the application is started (e.g. not 
compiled).
-jt





More information about the jigsaw-dev mailing list