Service provider module dependency resolving webrev

Paul Sandoz paul.sandoz at oracle.com
Tue Jun 19 09:53:51 PDT 2012


On Jun 19, 2012, at 5:43 PM, Alan Bateman wrote:

> On 19/06/2012 15:33, Paul Sandoz wrote:
>> Hi,
>> 
>> http://cr.openjdk.java.net/~psandoz/jigsaw/resolver-services/webrev/
>> 
>> - "permits" does not affect the resolving of service provider modules dependencies
>> 
>> - service provider modules dependencies are resolved after the explicit dependencies have been successfully resolved.
>> 
>>   - if service provider modules or their dependencies are service consumer modules then the correspond service provide modules
>>     are resolved after the explicit dependences and so on.
>> 
> I haven't tried your patch but I wonder about cases where the service provide modules have transient dependencies on modules that are in the initial chosen set, something like:
> 
> M
>  requires X;
>  requires service S;
> 
> P
>  requires X @ 1.0
>  provides service S with S1;
> 
> X @ 1.0
> 
> X @ 2.0
> 
> With today's implementation then M, P, and X at 1.0 will be chosen.
> 

Yes, since the service provider dependencies are pushed after the explicit dependencies.


> If I understand the proposal then M and X at 2.0 will be initially chosen and then P and its dependencies will need to be worked out. With the proposal then does this result in the same answer or will it fail because X at 1.0 and X2.0 cannot be the same configuration?
> 

I would need to verify but IIUC it will fail, since the service provider dependency is optional module P will not be included in the configuration, the resolver will calculate a successful solution, but will barf when verifying the optional constraint.

It's swings and roundabouts :-) i can come up with situations where the current approach may produce odd results or barf. For example another that happens to be processed before M:

  M'
    requires X @ > 1.0;


I am leaning towards a solution that may present a more consistent results to developers. With the current solution it can be harder to predict or understand how the system is affected by the presence of service provider modules since service consumer modules are decoupled from service provider modules.

Paul.


More information about the jigsaw-dev mailing list