Refactoring the Library API
brian at pontarelli.com
Fri May 8 07:42:31 PDT 2009
On May 7, 2009, at 2:28 PM, Jonathan Gibbons wrote:
> Mark Reinhold wrote:
>>> It would be much better, IMO, if all the
>>> information necessary to evaluate a module dependency graph was
>>> directly available in the module-info files themselves.
>> What we have now appears to be enough to compute a decent compile-
>> approximation to the run-time context graph. We do, however, need
>> practical experience with it.
>> If we need a better approximation, then I see only two ways to add
>> package information to module-info class files:
>> - Have the compiler record member packages in module-info.class.
>> - Extend the module compilation-unit syntax and require developers
>> to declare member packages.
>> I see lots of problems with both alternatives. Let's hope that the
>> simple approximation works well enough.
>> - Mark
> I don't like the idea of having to record package information in the
> module-info file.
> I would like to think we can identify Jigsaw "modifiers" to put in
> the requires
> declaration such that the resolver can create the correct module
> graph without
> requiring any knowledge of the packages in a module.
> Separately, I understand why you want to put package information for
> a module
> in the library. That can be done separately, at module installation
> time, and
> need not be part of the underlying module resolution algorithm.
> -- Jon
I'm pretty new to the list and the details of Jigsaw, but based on my
knowledge of things and how I do this in Savant, I would generate the
module-info file at release time (what you are calling installation
time). The only artifact released would be the module JAR file, which
could include all the necessary information to generate the module-
info.class file, and the installation tool would generate it and
release it as a sibling to the JAR (I would highly advise against
pulling dependency information from inside the JAR files). That would
allow full graph construction without incurring downloading overhead
and not force developers to manage two separate pieces. I don't have
full information about how Jigsaw defines and manages this
information, but Savant uses the primary build file (project.xml) to
generate an AMD file (artifact-meta-data) at release time. This is
also part of releasing integration builds.
More information about the jigsaw-dev