I think you are going too far for the start, is good to have the use
cases and the overall idea, but as soon as you get to the
implementation you will find things that you didn't thought about
before.
About the UI as long as you have the global idea of how it should work
then when you start with it you'll be able to refine and improve it.
It really shouldn't be a standalone application but something that can
be reused in an IDE, applet, ... Make sure you use a standard format
for the data so it can be reused easily, for instance I thing Prefuse
uses the GraphML format. I'd start with the base functionality as
first milestone (no interactive UI) and when that's finished think
about the next steps
On 5/19/07, Peter Kolbus <[EMAIL PROTECTED]> wrote:
As a Google Summer of Code participant, this summer I'll be working on a
dependency graphing plugin, with Carlos as mentor. See
http://docs.codehaus.org/display/MAVEN/Dependency+Graphing for background.
What follows is my design so far - my understanding of the use cases, an
overview of the UI elements, and the beginnings of the class design.
Questions:
* Is the list of use cases complete - is there anything that should be
added or removed?
use cases look right to me
* Does the UI seem appropriate for the tasks?
see my comments at the begining.
* (for Piotr) Should this be integrated with your work on static diagram
generation? If so, how well do my plans match up with yours?
definitely, you both have to work together and with the rest of the
people in the project, you can split the functionality as you wish,
but the core libraries for the same functionality must be shared.
I'll put this on the wiki once I get some sleep.
Peter
-------------------------------
Use Cases
The maven-grafo-plugin will allow Maven users to visually explore a
project's dependency structure and gain the necessary information to fix
dependency problems and effectively refactor the hierarchy of
dependencies.
Brett Porter identified the following uses:
* Identifying dependency exclusions. Is it excluded, and where did
exclusion originate.
* Identifying dependency version decisions. If maven picks another
version, which one, and why?
* Identifying dependency owner. If dependency is present in project,
how did it get there? By current project, by transitive dependency, or
by parent pom?
* Identifying transitive dependency complexity. Multi module project is
getting out of hand, what dependencies can i collapse safely into one dep?
* Identify relocated dependencies.
* Identify missing or bad dependencies.
Milos Kleint also identified:
* optional persistence of the visual data
* filters
* finding specific artifacts in the tree
* getting more information about artifacts
* answering "why was this artifact included?
* answering "why it changed scope or version?".
To help manage larger graphs, the following UI tasks will also be possible:
* Collapse a subtree: hide dependencies
* Change layout (force-directed, fixed, etc.)
* Pin an artifact to a particular location
User Interface
The UI is based around two goals in the grafo plugin, one to generate a
file, one to display the UI:
grafo:generate
Generate a file containing a dependency graph. Parameters:
format="xml" File format, corresponds to a sink.that
generates a graph in String format.
scope="foo" Name of the scope, defaults to compile.
file="foo.xml" Name of the file to save. Required.
grafo:ui
Display the current project dependencies in a GUI window.
grafoApplet
If time permits, a Java applet will be created. This will be a
simplified version of the grafo:ui except that the graph source will be
an XML file, and parameters such as dependency scope and filters will be
specified via applet parameters. The applet will not incorporate a menu
bar.
GUI: Main Window
The UI for the Java application will consist of a menu bar and a Prefuse
frame. The menus are as follows:
File...
...Open Open an XML graph file
...Save Save the current graph in XML or other format
Artifact
...Pin Pin (unpin) a node to particular X/Y coordinates
...Collapse Collapse (expand) the selected artifact's dependencies
to simplify the graph
...Properties Show a properties window.
Graph...
...Scope Show the graph for a particular scope (compile,
test, etc.)
...Filter Filter artifacts for groupId/artifactId/version
containing specified text
...Optional Show/hide optional dependencies
...Excluded Highlight/show/hide excluded dependencies
(default: hide)
...Version Conflicts Highlight all artifacts with more than one
version in the graph (selected by default)
...Relocated Highlight all relocated dependencies.
...Missing/Bad Highlight missing/bad dependencies (selected by
default)
...Compare Compare the current view to a GraphML file. The
GraphML file will be treated as the "old" version.
...Switch Layout Switch to a different Prefuse layout. The
available layouts are implementations of prefuse.action.layout.Layout.
Help...
...About Show the grafo-plugin version
The user may also right-click on an artifact in the graph to display the
Artifact menu.
GUI: Properties window
The properties window for an artifact identifies the following in a
dialog box with a Close button:
* Group, project, version, artifact type
* Repository URL
* Scope
* List of all artifacts that depend on this one (vertical scroll if
necessary)
* List of all artifacts that this depends on (vertical scroll if necessary)
* Whether the artifact is optional
* Included or skipped, and if skipped, why (in English). For example,
"This artifact is omitted because plexus-utils 1.4 (a dependency of
foo:bar 1.0) was nearer.
* Relocation details. One of "This artifact was not relocated", "This
artifact was relocated to group:artifact:version", or the relocation
message in the POM.
Class Design
A dependency graph is essentially a directed graph of
org.apache.maven.artifact.Artifact objects. A source/sink model is used
so that any representation of the graph can be translated to any other
representation. What follows are the model classes; the UI classes are
low complexity and will be "as necessary" to implement the UI specified
above.
IArtifactGraphSource
The Artifact Graph Source presents artifacts to sinks.
registerSink(IArtifactGraphSink sink)
unregisterSink(IArtifactGraphSink sink)
IArtifactGraphSink
This is an interface for dependency sinks, which are used to generate a
directed graph in a particular format for presentation.
clear()
Reinitialize the graph.
add(org.apache.maven.artifact.Artifact parent,
org.apache.maven.artifact.Artifact child)
Add an edge from parent to child. The child node is created if it
does not exist.
setProperty(Artifact artifact, String name, Object value)
Specify additional information about an artifact that was determined
by the sink, for example whether the dependency is skipped for a version
conflict, locked position on the graph, etc. Not all sources will set
all properties.
setGraphProperty(String name, Object value)
Specify a property that applies to the graph as a whole
Object getGraph(String scope)
Return the graph for the specified scope. If scope is null, the
entire graph is returned. The specific representation of the graph is
particular to the sink.
void saveGraph(File outputFile)
Serialize the graph to the specified
GraphSinkRegistry
The graph sink registry maintains references to the sinks that can write
meaningful file formats.
static void register(IArtifactGraphSink sink, String formatname,
FileFilter fileFilter)
Register a sink. formatname is the short format name ("png"), and
fileFilter is the corresponding FileFilter for use with a JFileChooser.
MavenArtifactGraphSource
This source presents artifact dependencies identified during Maven's
artifact resolution process.
XMLArtifactGraphSource
This DependencySource is used to read in an XML file.
XMLArtifactGraphSink
This is used to create an XML file.
PrefuseArtifactGraphSource
This source creates Artifact objects from a prefuse.data.Graph.
PrefuseArtifactGraphySink
This sink is used to create a prefuse.data.Graph of objects.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
-- The Princess Bride
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]