Added more doco to the design notes detailing the refactors I've already started.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163349 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2005-02-11 23:00:25 +00:00
parent 8ad0f8f745
commit e62b7cad61
1 changed files with 33 additions and 1 deletions

View File

@ -32,3 +32,35 @@
I don't anticipate needing this initially, but if there is some question I don't anticipate needing this initially, but if there is some question
of consistency wrt this, we can certainly provide one. of consistency wrt this, we can certainly provide one.
[[4]] Create common API for use in all generator libraries. This will define
the interface for a mojo descriptor (and other) generator. Therefore, it
will require splitting the responsibility of the old PluginDescriptorGenerator
from what is to be the maven-plugin-tools-java library into two pieces:
- Section covered by the AbstractGenerator code will be the complete new
generator for java. It will probably be further abstracted as an
interface for other language implementations to follow, and then itself
made into a concrete, instantiable implementation. The interface will
define the new Reader/Source role of this class, used to produce
MojoDescriptor instances from the project source files.
- Specifics handled by the PluginDescriptorGenerator (and others) will
be factored into the common API, and generalized as a Writer/Sink role,
used to generate one or more derivative files from the MojoDescriptors
discovered by the set of Reader/Sources.
Once this split is accomplished, an additional class will be created to
act as a managing component for all generators registered in plexus. It
will require a mapping of Source-language->Source-instance where each
Source is a plexus component. Unless/until we have some smarter way of
specifying a plugin language as a means of singling out one Source for
the project, this manager component will simply iterate through all
Source instances, collect the MojoDescriptors from each, wrap them in
MavenMojoDescriptors with the component-factory specified == to the
Source language, and aggregate the resulting MavenMojoDescriptors in
some Collection.
Finally, the Source manager returns the aggregated result of all Sources
to the calling mojo. The mojo will be responsible for digesting the
MavenMojoDescriptors into the requisite files.