home  |   software development  |   user experience  |   training services  |   print  |   audio  |   contact  
 
Getting Started with ModelMaker
Tutorial 4 — Diagramming Overview
 
 
Tutorial 4
Before we begin our discussion of diagrams, remember the following: ModelMaker maintains an internal active code model from which all source code units are generated. The various views (including the Diagram Editor) are simply different ways of looking into that model. The diagrams are not static, stand-alone images; they are graphical representations of the internal model, thus diagram symbols that represent code entities are actually showing us a representation of the entity in the model not just a graphic symbol. It‘s important to remember that distinction lest you try to delete a class from a diagram and wonder why the class still exists in the model.
ModelMaker currently offers the ability to create and manage 10 different types of diagrams, most of which are UML compliant. While most of the diagrams have toolbars and concepts that are specific to their types, there is some common ground with which I will acquaint you here.
There are two parts to the diagramming interface; the Diagrams View (F5) and the Diagram Editor (F8). The reason that these are mentioned separately is that it is possible to view the Diagram Editor while displaying any of the three main views (Classes, Units or Diagrams). See tutorial 2 for a listing of possible views and keystroke shortcuts. For the moment, display both diagramming views by pressing F5 (and if the Diagram Editor is not subsequently displayed, F8). If you are in a new project, with no diagrams, the Diagrams View should be blank and the Diagram Editor and toolbar should be grayed.

Figure 14 — the Diagrams
View toolbar.
The Diagrams View toolbar (figure 14) contains buttons which will add each of the supported diagram types (Class, Sequence, Collaboration, Use Case, Robustness, State, Activity, Unit Dependency, Implementation and Mind Map).
To begin, let‘s add a new class diagram. Click the Add Class Diagram button (the upper-left button) in the Diagrams Views toolbar. Note that a new diagram is added to the Diagrams View tree and the diagram editor is activated with the new class diagram. You can rename the diagram by selecting its node and pressing F2. It‘s always possible to simply add a new diagram to the diagram list by clicking one of the “Add…” buttons. Try clicking some of the other “Add…” buttons now to add some other diagrams to the tree. Notice that as the various diagram types are added, the Diagram editors toolbar displays tool buttons specific to that diagram type. You also see some tool buttons that are common to all diagram types and we‘ll discuss these in a bit.
The Diagrams View is hierarchical; we can add some diagrams and rearrange them to be children of other diagrams. Right-click the Diagrams View and select Advanced Add… from the context menu. The resulting dialog allows you to specify a name for your diagram, select a diagram type and assign a parent diagram all in one step. Select one of your existing diagrams as the parent for your new creation and click OK. Note that the new diagram is added to the tree as the child of the existing diagram. This is a nice organizational feature and comes in handy in projects that contain numerous diagrams. For existing diagrams, it‘s possible to “re-parent” them within the Diagrams View by simply holding down the Ctrl key and dragging the diagram to its new parent.

Figure 16.

Figure 15.
Next we‘ll look at some of the design elements common to all diagrams. Select any of the diagrams you have added and have a look at the toolbar of the Diagram Editor. For any diagram you select, you should see figure 15 at the far left of the toolbar and figure 16 at the far right.
Moving from left to right, these common tools are as follows:
– Select. Use this tool to select diagram elements.
– Delete from Diagram. This tool will delete a symbol from a diagram, but will not delete the entity it represents from the model.
– Delete Symbol and Linked Entity. This tool will delete a symbol from the diagram and will also delete the entity it represents from the model.
– Add Package. Use this tool to create a package symbol in your diagram. This symbol is “container” and can hold other symbols, much like TPanel in Delphi.
– Add Unit Package. Similar to the Add Package tool, this tool adds a symbol representing a physical Delphi unit to your diagram. The symbol automatically displays the entities contained within the unit.
– Add Annotation. This tool will create a standard UML annotation symbol in which you can enter text of any sort.
– Add Documentation Link. This tool and the next, Add Linked Annotation, have some subtle differences, but they can be summed up as follows: the three options in this drop-down button allow you to connect a symbol and an existing annotation symbol. Whereas the next tool, Add Linked Annotation, will create a new annotation symbol and link it to the selected symbol. The three options in the drop-down menu allow you to add your own annotation text, display the linked entity‘s documentation or its One Liner comment.
– Add Linked Annotation. This tool, like the one above, links documentation to a diagram symbol. Using this tool will add a new annotation symbol and link it to the selected symbol. The three options in the drop-down menu allow you to add your own annotation text, display the linked entity‘s documentation or its One Liner comment.
– Add Constraint Relation. This is rather self explanatory; use this tool to add a constraint relation between two symbols to the diagram.
– Add Hyperlink. This is a powerful tool. This symbol, when added, will allow you to add a hyperlink to your diagram which can link to another diagram, a code model entity and/or an external document.
– Add shape. Use this tool to add simple geometric shapes to your diagram.
– Add Image. This tool allows you to add an image from an external file to your diagram.

When trying to alter the appearance of your diagrams, keep in mind that double-clicking on a diagram symbol (including associations and relations) will display that symbol‘s editing dialog where you can change the visual attributes of the diagram symbol. However, before you start trying to format your diagrams one symbol-at-a-time, keep in mind the following: ModelMaker provides access to the display styles of diagrams and their symbols using an inheritance model. It is possible to set styles for diagrams at an environment level via the Diagrams tab in the Environment Options dialog; to override these settings for a particular project, you would do so in the Project Options dialog, available from the Options menu. To override the settings for a diagram, double-click the diagram to display the Diagram Style dialog. Likewise, double-click a symbol to display its Symbol Style dialog.
This should provide enough of a basic overview of diagramming in ModelMaker to get you started. See the online help for information about specific diagram types.

Return to the Introduction.
Go back to the previous tutorial.
Go on to the next tutorial.