Sei sulla pagina 1di 22

Summary

1. 2. 3. 4. Visual Paradigm for UML ....................................................................................................... 1 Creating the GeoProfile ......................................................................................................... 2 Applying Icons to Stereotypes ............................................................................................. 11 Applying the GeoProfile ...................................................................................................... 12

1. Visual Paradigm for UML


Visual Paradigm for UML (Visual Paradigm, 2010) is a CASE tool with several options for modeling with UML2 diagrams and also supports SysML requirements diagrams and ER diagrams. The tool has a good working environment, which facilitates viewing and manipulation of the modeling project. It is a business tool and also supports specific changes to source code of some programming languages such as C++ and Java.

Desktop for Visual Paradigm for UML 8.1

The UML profile support is offered, and also allowed the use of graphical notation for stereotypes. In the implementation of a profile, add to the stereotypes, as if the metaclass choose it will extend. This extension is not shown explicitly, as in RSM and Papyrus UML2 Modeler. It is also possible to perform import / export of models using
1

the standard format for exchanging models XMI. Unlike others, this tool offers the possibility to display more than one icon per class, if necessary. To implement the GeoProfile was used Visual Paradigm for UML version 8.1

2. Creating the GeoProfile


To create a profile in Visual Paradigm, right click on the root of the project "Untitled", on the Model Explorer tab, and select Create Profile on the menu that appears, you can take a new name to the project in the option Rename.

On the window Profile Specification that appears, give a name to the profile, in this case GeoProfile.

To create a diagram of the profile, even in the Model Explorer tab, right click on the profile you created earlier, and on the menu choose: Sub Diagrams -> New Profile Diagram.

Now we can add elements to create the GeoProfile in the diagram. First we create stereotypes of the profile, let's start with the stereotypes for network objects (NetworkObj, Arc, Node, and UnidirectionalArc BidirectionalArc). By adding an element of type Stereotype in the project, a window will appear for choosing the base type of stereotype, that is, which element extends UML stereotype. In this case, the aforementioned stereotypes extend the UML element Class.

On the palette of elements, add an element Stereotype, for each of the stereotypes mentioned above, so leave the template as shown below.

Note that stereotypes NetworkObj and Arc are abstracts. To place a stereotype as the abstract, simply select it on the model and check the option Abstract on the left inferior tab Property.

Now, generalize stereotypes using the element Generalization, so as to leave the profile as shown below.
4

Now let's create the stereotypes regarding the metaclass Association, dealing with the topological relationships among the geographical classes. There are six different types of topological relationships in GeoProfile, let's create just one for this example. First, create an element Stereotype, which now must have a base type NARY that refers to an N-ary Association element (n-ary association), and give it the name Temporal.

A stereotype may have properties, which may be referred to as tag definitions. When a stereotype is applied to a model element, the values of the properties may be referred to as tagged values. The next step is to create the stereotype TemporalObject and its enumeration (tagged values). Add one more element Stereotype in the scheme with base type Class.

To set a tagged value to a stereotype, right-click on it and choose the option Open Specification.
6

On the dialog Stereotype Specification that opens, open the flap Tagged Value Definitions. Click the Add button to choose the type of the tagged value. Choose Enumeration Tag.

Add two Enumeration Tags and label them as TemporalPrimitive and TemporalType.

Select the tagged value TemporalType and then click the Edit Enumeration button. On the window that opens, click the Add button to add the literals regarding to this tag. For this enumeration, GeoProfile sets two literal, instant and interval. After adding them, click OK to confirm.

Do the same now with the tag TemporalType, adding literals valid_time, transaction_time and bitemporal, defined in GeoProfile.
8

Click OK on the Stereotype Specification to apply the tagged values to the stereotype TemporalObj.

Thus it is possible to create the complete diagram for the GeoProfile according to your specification. Include the other Stereotypes and Generalizations that are missing in order to make the model as follows:
9

Stereotypes of GeoProfile

10

3. Applying Icons to Stereotypes


This tool allows the combination of icons to the stereotypes for a lighter representation of the elements of the diagram. To associate an icon to a stereotype, right click on the stereotype to which to apply the icon and choose Open Specification.

In the dialog Stereotype Specification that opens, open the General tab. On the Icon Path field select the icon that is applied to the stereotype.

Now you can add the other icons of other stereotypes: Point, Line, Polygon, ComplexSpatialObj, TemporalObj, TIN, Isolines, GridOfCells, GridOfPoints, IrregularPoints, AdjPolygons, Node, UniderctionalArc, BidirectionalArc, Touch, In, Cross, Overlap, Disjoint and Network. Then save the profile.
11

Despite good support for the inclusion of stereotypes and good usability, the tool does not support the language OCL for the definition of constraints. This constitutes a disadvantage, because it prevents the constraints included in GeoProfile are used to validate the conceptual schema.

4. Applying the GeoProfile


With the profile created, we can use it in our geographic modeling classes. To use our profile, we create a new model within the same project which the profile was created, for this, right click on the project tab in the Model Explorer, and on the menu select Model -> New Model.

The new model can also be created on the Start Page, choose the option to create a class diagram (Class Diagram).

12

On the window Model Specification that opens, name the model in the General tab.

To test the GeoProfile, add a class diagram created earlier, right click on it and choose the option Stereotypes -> Edit Stereotypes.

13

A window with the stereotypes that can be applied will appear. For this example we will only focus on stereotypes of GeoProfile. On the tab Stereotypes, select the stereotypes that we wish to apply. We will select the stereotypes Point and Polygon. Then click OK.

14

One problem with this tool is that it allows stereotypes that have been defined as abstract in the profile are added to classes, which in this type of application that cannot happen. Unlike others, this tool offers the possibility to display more than one icon per class, if necessary.

As defined in the profile GeoProfile, stereotypes can also be applied to relationships. However, this tool does not allow adding stereotypes to simple relationships (elements of type Association). One way around this is to apply stereotypes to elements of the relationship compound N-ary Association, as previously defined in the profile creation. NARY elements allow us to create a relationship between more than two classes. Therefore, to create a relationship between two classes, we add an N-ary Association element and a joint relationship between the classes Association and this element.

15

Now we can apply a set of stereotypes for relationships of GeoProfile in the element N-ary Association. The procedure to add a stereotype to this element is identical to that described for elements Class.

If there are more classes pertaining to this relationship, they can be included by adding an association between the class and the NARY element.

16

If there is not a topological relationship between the classes, we can use just a simple object Association between them.

Because it is a tool that supports UML, other UML elements also can be added to the model as packages, attributes, operations, data types, etc. The properties of the elements added in the model can be changed in the Property tab, which contains all the attributes of the selected element.
17

Another type of geographic object that can be found in our applications are the temporal objects, defined in GeoProfile as TemporalObj. For this type of object were defined two tagged values, temporalType and temporalPrimitive. To define their values, we must first add a class on the model with the TemporalObj stereotype.

Now, open the window Class Specification, with a right click on the class, choose Open Specifications.
18

On the window that opens, open the flap Tagged Values to display the tags defined for this class.

The value of each tagged value can be defined at the field values, which contains the default values in the profile.
19

These values can also be defined in the Property tab, selecting the class in the model.

20

With this, it is possible to create a complete UML model for modeling geographic database in the tool Visual Paradigm using the GeoProfile. An example of "School" using this profile is shown below.

Note that the classes Cidade (city), Escola (school) and Bairro (district) have stereotypes such as <<Point>> and <<polygon>>, it shows how the class may be represented in a geographic application. Bairro, for example, can be represented as a point or a polygon, depending on the scale. The class Aluno (student), in turn, has not stereotype, because it is a class without geographic representation will thus be created as a common object class, without applying any stereotype. Note also that were applied stereotypes to NARY relationships. The stereotype <<in>> between Bairro and Cidade topologically shows that every Bairro element is within a Cidade element, the same goes for the relationship between Escola and Bairro. There is no topological relationship between Aluno and Escola, so we use only one common relationship Association, without applying any stereotypes. Visual Paradigm also allows import and export models in XMI format (XML Metadata Interchange). The option File -> Import / Export -> XMI designers can export the current model for the XMI format or import a previously created template.

21

More information about this tool can be found at: http://www.visual-paradigm.com

22

Potrebbero piacerti anche