Now that new elements have been created, they must be modified in order to be meaningful to the model.
The diagram drawing area in the Diagram pane not only allows for creating, deleting and moving graphical elements; it is also possible to enter values, such as names, directly into the elements without using a different pane. Exactly which element properties can be modified depends upon the specific element. Most of the elements allow editing of the name of the element at a minimum. For example, selecting a state from within a state diagram and then typing will immediately open a small text editor. When editing is finished, the typed text will replace the previous text in the navigation tree and Properties tab, as well as in the diagram of the selected state.
Classes and interfaces offer far more options for editing values than just editing their names. Both of them are constructed of different parts called compartments. The first compartment holds the values for the name, the stereotype and the package of the class or interface. You can edit the name of the class as described above; however, stereotypes and packages can only be changed using the Properties tab. The second and third compartments hold the attributes and operations defined for the class or interface (in UML, interfaces can have operations only). Inline editing works the same way here. Select the attribute or operation you want to change and start typing (or double-click on it to open the inline editor). Press Ctrl-Return on the keyboard or click elsewhere in the application to end the editing.
After editing an attribute or operation, you can directly add another attribute or operation without leaving the element by hitting 'return' on the keyboard instead of Ctrl-Return after editing the first attribute or operation.
You can also create a new attribute or operation with a rapid button by moving the mouse to the right side of the compartment and then clicking on the 'create' button that appears. As above, Ctrl-Return will end the editing and add the new attribute/operation to the class or interface, and 'return' on its own will end the editing and create a new attribute or operation..
The attributes and operations compartments in the diagram can be set to invisible for the current diagram via the Context menu, or for the entire model via the 'Settings' dialog from the 'Edit' menu.
The first tab you will see in the Details pane is the Properties tab.
There are many modifications that can be made to elements from the Details pane. You can add attributes and operations, rename elements, change namespaces and stereotypes, add colors and borders, and much more. This section will outline some of the most important modifications that can be made. Many of these procedures can be extrapolated to other editing procedures.
Let's look at a class element, as these are very frequently used elements.
The toolbar across the top of the tab contains buttons for navigation between elements, creation buttons, and a delete button. These buttons will change depending on the type of element selected as the current active element.
Below this toolbar are the editable characteristics of the class. The name of the element can be typed directly into the name field with no restrictions. Likewise, Visibility and Modifiers can be directly modified from their checkboxes. Note, however, that these two properties are not displayed in the diagram itself, thus the changes made will be visible only from the Properties tab (the modifier 'abstract' is the exception to this). The Namespace must be selected from the list of available options. Stereotypes can be applied through the Stereotypes dialog, accessed by right-clicking the Stereotypes field and selecting 'Edit' from the context menu that appears. The Owned Elements section is automatically populated.
All changes made to the class are propagated throughout the model. For instance, when a namespace is changed, the navigation tree is updated and the class is moved from the original package to the new one that was just selected. This change is also reflected in the Diagram pane: the top compartment of the class will display (from new_namespace) in place of (from old_namespace), where old_namespace and new_namespace refer to the original namespace and most recently selected namespace. This easy and convenient mechanism for changing namespaces is provided for nearly all of the elements.
To the left of the editable characteristics are elements which are affiliated with the selected element. In UML, operations and attributes are considered both an elements in their own right as well as a characteristics of a class. As they are elements, they have their own Properties tabs. Therefore, to edit the name or any other properties of an operation for example, we must go to the Properties tab of that operation. That is why it is not editable here. The remaining fields are: Extends, Implements, Associations, and Derived. These properties show different relations between the focused class and other model elements.
Next we can look at the Style tab, which determines how the element is rendered in the diagram.
The Style tab determines which colors and fonts will be used to display the element. This is very useful when color-coding diagrams or highlighting aspects of the diagram. As with the properties tab, not all of the options make sense for every element. Therefore, only the appropriate style options are available.
Options for the Style tab:
Fill - Determines the background fill color of the element
Lines - Determines the border color of the element
Font - Determines the color and font of the text.
Whereas changes made to an element in the Properties tab are propagated throughout the model, changes made to the style of an element apply to the current diagram only.
The Context menu can be accessed by right-clicking on an element in a diagram. Entries relevant to the selected element are displayed. Remember that things like attributes and operations are considered elements in their own right, therefore the context menu for an attribute will be different than that for the class in which it occurs. If you do not see what you expect, be sure that you have selected the proper element to be the active element.
The Show option displays all checked items in the diagram. In the case of a class element, this includes stereotype, package, and compartment options. Unchecked items remain hidden from view.
It is also possible to create things like attributes, operations, and dependent edges when appropriate. These items are listed towards the bottom of the context menu and, once created, are available for editing in the Properties tab.
One of the general patterns of an architecture is the Model-View-Controller-Pattern, or the Boundary-Control-Entity-Schema, as it is often rephrased in the UML community. According to this, an architecture is constructed in three layers.
First, the Boundary is responsible for representing information to the user and receiving his interactions. Users of the system interact with this layer only. The next layer, Control, contains the rules on how to combine information and how to deal with interaction. It is responsible for transferring control based on the input received from the Boundary layer. And finally, the Entity layer holds the data and is responsible for its persistence. To which layer a class belongs is expressed using corresponding stereotypes. You obtain these in the Properties tab of each class. An example for the usage of stereotypes is shown below.
The code generation functionality of Poseidon for UML can distinguish between different stereotypes for the same element type. In this way it can select the appropriate template for generation based on both of these factors. Stereotypes can be displayed for nearly every element type.
Poseidon supports multiple stereotypes for single elements. Adding, editing, and removing these stereotypes is accomplished via a dialog that is accessible from the Details pane.
To access the Stereotype dialog:
Select the element the stereotype applies to from the diagram, Details pane, or Navigation pane.
Open the Properties tab for this element in the Details pane.
Right-click in the Stereotype box.
Select 'Edit' from the menu.
Once this dialog is open, altering and applying stereotypes is quite simple. The buttons with the arrows allow you to add and remove stereotypes from the element. The 'Add' box below the list of stereotypes will create new stereotypes, but will not automatically add them to the element. Removal of stereotypes from an element is only possible through this dialog. Selecting a stereotype and clicking the delete button will remove the stereotype from the model completely, not just from the selected element.