mirror of https://github.com/dspinellis/UMLGraph
109 lines
2.7 KiB
XML
109 lines
2.7 KiB
XML
<?xml version="1.0" ?>
|
|
<notes>
|
|
Views are especially interesting in big projects, since they allow to
|
|
generate package specific diagrams and overview diagrams in a quick and
|
|
consistent way. <br/>
|
|
|
|
As an example we include a few class diagrams that have been generated
|
|
from the <a href="http://jakarta.apache.org/commons/dbcp">DBCP connection pool</a>,
|
|
without altering the sources and using association and dependency inference
|
|
instead.<br/>
|
|
|
|
The base view defines commons options, in particular the use of inference,
|
|
common class coloring and class visibility (in particular, we hide the
|
|
java runtime classes, with the exclusion of a few java.sql classes).
|
|
To avoid visual clutter, we have first shown the java.sql package contents, and
|
|
then hid selected classes.
|
|
The <code>Overview</code> view provides a full view of the DBCP package,
|
|
generating quite a big diagram (click on the diagram to show a full size version).<br/>
|
|
|
|
<fmtcode ext="java">
|
|
package org.apache.commons;
|
|
|
|
/**
|
|
* @view
|
|
* @opt inferrel
|
|
* @opt inferdep
|
|
* @opt useimports
|
|
*
|
|
* @match class .*
|
|
* @opt nodefillcolor LightGray
|
|
*
|
|
* @match class org.apache.commons.*
|
|
* @opt nodefillcolor PaleGreen
|
|
*
|
|
* @match class org.apache.commons.dbcp.*
|
|
* @opt nodefillcolor LemonChiffon
|
|
*
|
|
* @match class java.*|org.xml.*
|
|
* @opt hide
|
|
*
|
|
* @match class java.sql.*
|
|
* @opt !hide
|
|
*
|
|
* @match class java.sql\.(Ref|Time|Timestamp|Array|Date|Time|Clob|Blob|SQLException|.*MetaData.*|SQLWarning)
|
|
* @opt hide
|
|
*/
|
|
public abstract class BaseView {
|
|
}
|
|
|
|
/**
|
|
* @view
|
|
*/
|
|
public class Overview extends BaseView {
|
|
}
|
|
</fmtcode>
|
|
|
|
<a href="dbcp-overview-full.png"><img src="dbcp-overview-small.png" alt="Overview"/></a>
|
|
|
|
<p/>The <code>CommonsDbcp</code> view concentrates on the content of org.apache.commons.dbcp
|
|
package, hiding other packages and subpackages available in the sources
|
|
(click on the diagram to show a full size version).<br/>
|
|
|
|
<fmtcode ext="java">
|
|
package org.apache.commons;
|
|
|
|
/**
|
|
* @view
|
|
*
|
|
* @match class org.apache.commons.*
|
|
* @opt hide
|
|
*
|
|
* @match class org.apache.commons.dbcp..*
|
|
* @opt !hide
|
|
*
|
|
* @match class org.apache.commons.dbcp..*\..*
|
|
* @opt hide
|
|
*/
|
|
public class CommonsDbcp extends BaseView {}
|
|
</fmtcode>
|
|
|
|
<a href="dbcp-full.png"><img src="dbcp-small.png" alt="Overview"/></a>
|
|
|
|
<p/>Finally, the <code>Statement</code> view shows only the Statement related
|
|
classes and their dependencies.
|
|
|
|
<fmtcode ext="java">
|
|
package org.apache.commons;
|
|
|
|
/**
|
|
* @view
|
|
*
|
|
* @match class org.apache.commons.*
|
|
* @opt hide
|
|
*
|
|
* @match class org.apache.commons.dbcp\..*Statement.*
|
|
* @opt !hide
|
|
*
|
|
* @match class org.apache.commons.dbcp..*\..*
|
|
* @opt hide
|
|
*/
|
|
public class Statement extends BaseView {
|
|
}
|
|
</fmtcode>
|
|
|
|
<img src="dbcp-statement.png" alt="Statement"/>
|
|
|
|
</notes>
|
|
|