<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    On 19/12/2024 20:54, David Lloyd wrote:<br>
    <blockquote type="cite" cite="mid:CANghgrS_dEnhXaYTbT3w9k72oW6xpo_411yC3KjBM-nUgvj=9A@mail.gmail.com">
      
      <div dir="ltr">
        <div dir="ltr">
          <div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I wonder:
            would this also allow services to be found across the layer
            boundaries? For example, an API from a layer that the
            application can see uses a service provided by an
            implementation in a layer that the application cannot see?</div>
        </div>
      </div>
    </blockquote>
    <br>
    Service loading is specified to work across module layers. Code in a
    child layer might invoke ServiceLodaer to locate providers in its
    own and parent layer, assuming the service is in the parent layer.
    Code in the parent layer might invoke ServiceLoader to locate
    providers in the child layer. If everyone were in the same room in
    front of a white board then this would be easy to draw.<br>
    <br>
    An important point about service providers is that they be fully
    encapsulated. So while many modules can "see" the service provider
    module, where "see" means visibility, then nobody can access. <br>
    <br>
    -Alan<br>
  </body>
</html>