Page 1 of 1

About Question enthuware.ocpjp.v21.2.3445 :

Posted: Sun Jan 19, 2025 10:38 am
by dameest
Hello, can you please clarify your example because it seems incomplete to me. In customer module-info, You said: note that abc.print module is not required. How will the customer module find an implementation for Print service if it doesn't require a module which implements one?

Re: About Question enthuware.ocpjp.v21.2.3445 :

Posted: Sun Jan 19, 2025 8:31 pm
by admin
The module system and the Java service locator mechanism automatically make all available implementations of a service accessible to any module that says it requires that service. That's the whole point of declaring a service interface in a separate module. So that there is no direct dependency on the implementation module.

For details, please go through a good book such as Deshmukh's OCP 17 21 Fundamentals.