modules vs module "interfaces"?
Hendy Irawan
hendy at soluvas.com
Wed Oct 17 09:31:12 PDT 2012
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.
--
Hendy Irawan - on Twitter <http://twitter.com/hendybippo> - on
LinkedIn<http://id.linkedin.com/in/hendyirawan>
Web Developer | Bippo Indonesia <http://www.bippo.co.id/> | Akselerator
Bisnis | Bandung
More information about the jigsaw-dev
mailing list