Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In JAVA, A UML diagram that helps with the process: Be sure to include the follo

ID: 643958 • Letter: I

Question

In JAVA,

A UML diagram that helps with the process:

Be sure to include the following methods: Constructor - accepts an integer argument specifying the length of the queue. enqueue - Accepts a value to put in the queue. Throws an exception if the queue is full. dequeue - Returns a value from the queue. Throws an exception if the queue is empty. Is Full - Returns true if the queue is full, false otherwise. Is Empty - Returns true if the queue is empty, false otherwise. toString - Returns a string representation of the queue. You may not use the Java API queue container (Java.util.Queue). For the exception, Just throw an Exception, i.e., new Exception(Something?

Explanation / Answer

UmlGraphDoc is a standard doclet wrapper that combines the standard doclet output (javadoc documentation) along with auto-generated class diagrams for both packages and classes. The UmlGraphDoc process is driven by all the parameters that can be specified for UMLGraph and the standard doclet; each will be passed to the appropriate doclet. Diagram generation is based on the idea of context:

The actual content of the diagrams depends on the kind of relations declared on the class files (with the UMLGraph javadoc annotations) and/or on the kind of automated inference that UMLGraph is allowed to use. UMLGraph javadocs are now generated with UmlGraphDoc with the following ant target:

<target name="javadocs" depends="compile">
        <javadoc sourcepath="${src}" packagenames="org.umlgraph.doclet.*" destdir="${javadoc}"
                 private="true">
                <doclet name="org.umlgraph.doclet.UmlGraphDoc" path="${lib}/UMLGraph.jar">
                        <param name="-inferrel"/>
                        <param name="-inferdep"/>
                        <param name="-hide" value="java.*"/>
                        <param name="-collpackages" value="java.util.*"/>
                        <param name="-qualify"/>
                        <param name="-postfixpackage"/>
                        <param name="-nodefontsize" value="9"/>
                        <param name="-nodefontpackagesize" value="7"/>
                        <param name="-link" value="http://java.sun.com/j2se/1.5.0/docs/guide/javadoc/doclet/spec"/>
                        <param name="-link" value="http://java.sun.com/j2se/1.5/docs/api"/>
                </doclet>
        </javadoc>
</target>

When generating documentation with UmlGraphDoc you will encounter at some point the "fur ball" effect: some central classes that have very complex context diagrams. To reduce this, you can avoid dependency inference altogheter, or reduce the number of inferred dependencies by using the -inferdepvis options. If you find that this is not enough and have suggestions on how to improve the situation further, we are eager to listen.

Class Diagram Views

Documenting a big project often requires multiple diagrams: each to show a specific and limited portion of the system. Each diagram is usually composed of few classes, possibily using a different detail level.

The @view tag, marks a special class used to describe a single class diagram. Similarly to UMLOptions, the view can define its own general options, but allows to define overrides that allow to adopt different options for different classes based on regular expressions matching. The general syntax for defining a view is:

/**
* @view
* @opt [!]viewOption1
* @opt [!]viewOption2
* ...
* @match matchtype regularExpression1
* @opt [!]option1.1 [argument]
* @opt [!]option1.2 [argument]
* ...
* @match matchtype regularExpression2
* @opt [!]option2.1 [argument]
* @opt [!]option2.2 [argument]
* ...
*/

At the moment UMLGraph supports only the 'class' match type, in the future other types of match will be added (tags, implemented interfaces, superclasses, just to name a few possibilities).
The view options are applied to every class in the view (so they are the global options for this class diagram).
The regular expression will be used to match a single class, a group of classes, or a package, and the options that follow will be applied to those classes.
Multiple matches will be evaluted in the order of specification.
Refer to the Pattern (http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html) class documentation for details on a proper regular expression specification.

Each view will generate a .dot file whose name is the name of the view, unless the "output" option is specified to override it.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote