<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    On 20/12/2024 14:20, David Lloyd wrote:<br>
    <blockquote type="cite" cite="mid:CANghgrR0YdnjzkC+gzCHMU5tmuaB1XkjmWVFj=k+7UpMfAeiQg@mail.gmail.com">
      
      <div dir="ltr">
        <div dir="ltr">
          <div class="gmail_default" style="font-family:arial,helvetica,sans-serif">:<br>
          </div>
        </div>
        <div><br clear="all">
        </div>
        <div>
          <div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I see, so it
            seems that there still would have to be a parent-child
            relationship (possibly transitive) between the layer
            containing the service consumer and the layer containing the
            service provider, correct? And the provider must be in a
            parent layer. I.e. using `jlink` doesn't magically make this
            constraint disappear, which is what I thought was being
            implied.</div>
          <br>
        </div>
      </div>
    </blockquote>
    By "service consumer" then I assume you means the code calling
    ServiceLoader.load. That code may be in a different module (and
    module layer), to the service class, which in turn may be in a
    different module/layer to provider class. The module with the
    service class may be in the same module layer as the module with the
    provider class, or the module with the provider class may be in a
    child layer. It can't be the other way around as the provide class
    extends/implements service class. The "service consumer" needs to be
    able to access the service class, and express at either compile-time
    or reflectively, that it uses the service, but otherwise can be
    anywhere in the picture.<br>
    <br>
    jlink doesn't know anything about module layers at this time but
    there is a of interesting directions that could be explored.<br>
    <br>
    -Alan<br>
    <br>
    <br>
    <br>
  </body>
</html>