New page: Hint in a modular system allows expressing, default, preferred and actual solution to particular configuration problem. A module system like Jigsaw may use hints to elimina...

New page

[[Hint]] in a [[modular system]] allows expressing, default, preferred and actual solution to particular configuration problem. A module system like [[Jigsaw]] may use [[hint]]s to eliminate the [[NP-Complete]] nature of its [[JigsawServices]].

== Levels of Configuration ==

The general principle should be: the one that [[SuperVsInner|knows more]] should make the
decision:

# a JAXP API knows it needs an implementation of its [[API]] and it knows that [[Xerces]] module provides one that is good enough. This is an example of [[Convention over Configuration]] - unless somebody overrides my default, use [[Xerces]].
# the application vendor (providing the application module) knows all the modules in its application and all the services and can decide certain services should have different default (this is what [[Maven]] tries to do with its ''shortest'' path [[dependency]]). Also when compiling the whole application, it should be easy to decide whether different services are compatible with the rest of modules or not as one knows the transitive closure of the whole application.
# a deployer should have the option to override the application defaults without coding in [[Java]] of course one needs to install com.myapp.xsltproc module into the appropriate [[Jigsaw]] [[library]] as well as org.apache.crimson module, so the resolver can enable both.

The 3rd level could be achieved from a command line or by using configuration file of [[XML|yet undefined format]]:

<source lang="bash">
$ java \
-module com.myapp.xsltproc \
-service javax.xml.parser.DocumentBuilderFactory \
-default org.apache.crimson.CrimsonBuilderFactory
</source>