Transitive dependencies question

Alex Buckley alex.buckley at oracle.com
Thu Jul 28 18:49:14 UTC 2016


This scenario is explicitly discussed in "Jigsaw Under The Hood". The 
presentation shows how the definition of readability allows modules to 
support "downward decomposition" without affecting the ultimate consumer.

The term "transitive dependencies" needs a little care because sometimes 
you'll want it to refer to the transitive closure of all dependencies 
(both 'requires' and 'requires public') and sometimes you'll want it to 
refer to the transitive closure of only the 'requires public' clauses. 
The jlink tool building an image wants the former meaning, while an IDE 
inferring the API available by depending on a module wants the latter 
meaning.

Alex

On 7/28/2016 8:44 AM, Paul Benedict wrote:
> Here is an example use case. Please confirm my understanding. I'd like to
> know if transitive dependencies go one module deep or go all the way
> through.
>
> 1) A at 1.0 is published
>
> module A {  // exports all packages }
>
> 2a) A at 1.1 gets split into B at 1.0 and C at 1.0
> 2b) A at 1.1 uses "requires public" to mimic its previously unsplit self
>
> module A {
>      requires public static B;
>      requires public static C;
> }
> module B {  // exports all packages }
> module C {  // exports all packages }
>
> 3a) B at 1.1 gets split into X at 1.0 and Y at 1.0
> 3c) B at 1.1 uses "requires public" to mimic its previously unsplit self
>
> Assuming one level deep...
> module A {
>      requires public static B;
>      requires public static C;
> }
> module B {
>      requires public static X;
>      requires public static Y;
> }
> module C {  // exports all packages }
> module X {  // exports all packages }
> module Y {  // exports all packages }
>
> Will this chain of configuration allow consumers of A to notice no
> difference?
>
> Cheers,
> Paul
>


More information about the jigsaw-dev mailing list