modules vs module "interfaces"?

Alan Bateman Alan.Bateman at oracle.com
Wed Oct 17 09:48:51 PDT 2012


On 17/10/2012 17:31, Hendy Irawan wrote:
> Hi,
>
> I'm new in Jigsaw.
>
> > From reading the specs it seems there is no distinction between module name
> and a module "specification/interface/API" name.
> Basically a similar concept to the distinction between classes and
> interfaces.
>
> A real world usecase is in logging. SLF4J API 1.7 is implemented by
> Logback, SLF4J-JDK14, and also Pax Logging.
>
> During build time, an application JAR would depend to e.g. org.slf4j @
> 1.7.0.0; then org.slf4j @ [1.7.0.0,2.0.0.0) or any other module which
> conforms to slf4j 1.7 can be provided for building.
> For testing and runtime, both a module conforming to org.slf4j @ 1.7.0.0
> and an implementation, such as logback or others is required.
>
> The point here is that even though the JAR was originally built with
> org.slf4j @ 1.7.0.0, in other cases (testing/runtime/etc.) the concrete
> org.slf4j module is not explicitly required, because it can be replaced
> with another module, like org.ops4j.pax.logging @ 2.0.0, which happens to
> implement org.slf4j @ 1.7.0.0, and also org.apache.commons.logging @ 1.1.1,
> and also log4j packages, and also JUL packages, and also OSGi logging
> service. (so Pax Logging is actually a 5-module-in-1 module)
>
> In OSGi this is handled using Import-Package mechanism, but I haven't seen
> similar to this in Jigsaw.
>
> Thank you.
Have a look at services:

http://openjdk.java.net/projects/jigsaw/doc/openjdk-jigsaw-modular-services.pdf

-Alan



More information about the jigsaw-dev mailing list