Register Now
Member Count: 176,721 - November 20, 2008  [Get Time]
Login
Dashboard > TopCoder Competitions > ... > TopCoder UML Tool Source Code > UML Tool Application Design Specification
TopCoder Competitions View a printable version of the current page.  
UML Tool Application Design Specification
Added by tonyj , last edited by tonyj on Feb 15, 2008
Labels: 
(None)

1.   Model

The model for the UML Tool is made of simple data classes, as specified in the UML Model from OMG, UML 1.5. The classes and attributes used are selected from that model, as this application supports only four types of diagrams.
The graphical data is stored in the Diagram Interchange model, version 2.0. This package is implemented almost completely.

There are no semantic constraints imposed directly in the model. These will be implemented consequently to the actions executed on the model. However, the model must have a valid state at all times.

1.1     UML Model

The UML Model classes needed are extracted in the provided class diagrams with the UML Model. They contain only what is needed to fulfill the existing requirements (there are a few places where more then needed classes and attributes are provided, but these are rare cases).

All the model entities are provided as interfaces, as there are multiple inheritances, which are not allowed in Java. In addition, each interface has a class implementation, which is abstract if it does not make sense for the entity to be concrete (these are provided in order to be able to reuse existing code in the subclasses, which might belong to different packages / components).

1.2     Diagram Interchange

The graphical information of the diagrams is stored in the Diagram Interchange classes. This package is implemented directly by using classes, as there are no multiple inheritances.

This package supports containment hierarchies.

The UML Model elements are referenced using an UML1SemanticModelBridge graph node.

The actual elements and relationships are drawn using graph nodes and edges. These will be made of multiple compartments, some having more contained compartments. The semantic of these compartments is represented using SimpleSemanticModelElement.

1.3    UML Model Manager

In order for the application to have a central point of access to the model, the model manager was provided. It provides a Singleton instance (pseudo-Singleton, as other instances are also allowed), as a normal usage of an UML Tool involves only one model.

2.  Controller Manager

The controller part of the application is made out of an Event Manager and an Action Manager. For each action that can be triggered by the user through the GUI, the proper actions are provided in several components.

2.1.1    Event Manager

The Event Manager will be the component where all the events that occur in the GUI will be passed for handling. This includes the action events, which involve complex interactions with the model, undo/redo events and GUI events, which are meant to make different GUI parts to be coordinated. The events can be validated, in case there is a need for it, and the events can be accepted, modified or denied.

2.1.2     Action Manager

The Action Manager will be the component responsible for executing the actions and for keeping an undo/redo manager with the list of actions to be undone and redone. It provides the interfaces for simple actions (that cannot be undone and that reset the undo/redo manager), undoable actions and transient actions (which do not affect the state of the undo/redo manager). It also provides a compound undoable action, as the concrete actions provided are close to an atomic level and the actual actions that are significant to the user will be made of multiple simple undoable actions.

2.1.3     Concrete Actions

There are several components with actions to be performed by the user. These cover the whole range of user actions, from project related actions to actions performed in the GUI that affect the model. The actions provided are simple. Some of them cover the entire functionality that a user might request, while others should be grouped together in order to create an action that makes sense for the user. For instance, removing a package with all the contained elements and edges connected to it and the contained elements will be made out of the actions that remove each line, the actions to remove the elements, starting from the leaves, and finally the action that removes the actual package. Same thing applies to copy / paste and to actions that apply to a group selection.

3.  View Manager

The view is made of the main diagram viewer, with the diagrams, the general elements framework (nodes, container of nodes, edges) and the actual concrete elements that correspond to the UML Model elements. In addition, the properties panel, the documentation panel, the style panel, the elements toolbar and the document tree are provided.

These GUI panels will generate GUI events besides the normal action events that affect the model, in order to give the possibility to the other panels to react so that all the parts of the application are coordinated.

3.1.1     Diagram Viewer

The diagram viewer is the main part of the GUI, the one that displays the diagrams. It provides the actual graphical diagrams, which can be zoomed.

3.1.2     Diagram Elements Framework

The diagram will contain nodes and edges, which are provided in a general component that describes the general behavior of these elements: the ability to be moved around the diagram, the behavior of the edges and the texts attached to them...

3.1.3     Concrete Elements

The concrete elements specific to each type of diagram are provided in several other components. These elements will get the graphical information from the corresponding graph nodes and the logical information from the model elements referenced by the graph nodes.

3.1.4     Auxiliary panels, the elements toolbar and the document tree.

There are several panels provided: properties panel, documentation panel and style panel. The toolbar with the elements to be added to the diagram is also provided and the document tree, which is used by the user to browse the UML Model, using different views.

4.  Utility Manager

This part of the application is made of utility components. They were provided because the functionality is far too complex to be required in the actions.

4.1.1     XMI Reader

The main component and the concrete plug-ins are responsible for reading the model from an XMI file into memory.

4.1.2     XMI Writer

The main component and the concrete plug-ins are responsible for writing the model into an XMI file.

4.1.3     Stub Class Generator

This component is responsible for generating class stubs in Java and C# from UML Model classes.

4.1.4     Print Manager

This component is able to print a generic JComponent. The diagrams will be printed using this component

4.1.5     Image Exporter

This component is able to save to an image file a generic JComponent, in different formats. The diagrams will be exported to image files using this component

4.1.6     UML Project Configuration

This component provides the general configuration for an UML project, according to the language.

4.1.7     Standard Class Data Loader

This component will load standard class data for a given language from an easy to read and write XML file.