Refactoring the Library API
mr at sun.com
Fri May 8 08:25:03 PDT 2009
> Date: Thu, 07 May 2009 13:28:54 -0700
> From: jonathan.gibbons at sun.com
> 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.
Agreed, and for the compiler's purposes I think we already have what we
need in module-info files.
> 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.
I think we're getting confused over what a "resolver" is, and I suspect
it's because I've overloaded the term.
If a resolver's job is just to compute a module-dependence graph (well,
really a context graph) and choose a single version of each module, then
that's phases 1 and 2 of what's currently in the Resolver class.
Phases 3 and 4 might better be called "configuration", something that's
done at install time but not at compile time.
This suggests that I should refactor the Resolver class by splitting the
last two phases out into a separate Configurator class. I'll try to do
that when I revisit that code, likely next week.
More information about the jigsaw-dev