<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 23 Apr 2023, at 22:44, Rob Bygrave <<a href="mailto:robin.bygrave@gmail.com" class="">robin.bygrave@gmail.com</a>> wrote:</div>
<div class="">
<div dir="auto" class="">
<div dir="auto" class=""><span style="font-size:12.8px" class=""><br class="">
</span></div>
<div dir="auto" class=""><span style="font-size:12.8px" class="">So if app module A uses Y it will have:</span></div>
<div dir="auto" class=""><span style="font-size:12.8px" class=""><br class="">
</span></div>
<div dir="auto" class=""><span style="font-size:12.8px" class=""> requires y.</span></div>
<div dir="auto" class=""><span style="font-size:12.8px" class=""><br class="">
</span></div>
<div dir="auto" class=""><span style="font-size:12.8px" class="">If app module A uses X and Y it will have:</span></div>
<div dir="auto" class=""><span style="font-size:12.8px" class=""><br class="">
</span></div>
<div dir="auto" class=""><span style="font-size:12.8px" class="">requires x;</span></div>
<div dir="auto" class=""><span style="font-size:12.8px" class="">requires y;</span></div>
<div dir="auto" class=""><span style="font-size:12.8px" class="">requires y.inject;</span></div>
<div dir="auto" class=""><span style="font-size:12.8px" class=""><br class="">
</span></div>
<div dir="auto" class=""><span style="font-size:12.8px" class="">We now need everyone using x and y together to explicitly know that y also provides a plugin and that they ALSO must remember to add the requires x.inject; (and x.inject has no exports, it only
has the provides).</span></div>
<div dir="auto" class=""><span style="font-size:12.8px" class=""><br class="">
</span></div>
<div dir="auto" class=""><span style="font-size:12.8px" class="">Have I understood correctly? </span></div>
</div>
</div>
</blockquote>
</div>
<br class="">
<div class="">Not quite. If it uses X and Y it will have::</div>
<div class=""><br class="">
</div>
<div class=""> requires x;</div>
<div class=""> requires y;</div>
<div class=""> uses x.Plugin;</div>
<div class=""><br class="">
</div>
<div class="">which is exactly what you wanted, no? (You don’t even need `requires y` if Y’s other functionality is not used directly).</div>
<div class=""><br class="">
</div>
<div class="">The y.inject module can be on the module path whether or not the application has X. It’s just not resolved unless some module `uses x.Plugin`, and to do that it must also `requires x` since that’s the module that defines the service interface
`x.Plugin`.</div>
<div class=""><br class="">
</div>
<div class="">— Ron</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</body>
</html>