03.08.2013 Views

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Introduction<br />

Appendix A: UML — Unified Modeling Language<br />

UML (the unified modeling language) [40][118] defines a suite of visual syntaxes for describing<br />

various aspects of software architecture. We make heavy use of two of these visual syntaxes, package<br />

diagrams and static structure diagrams. These syntaxes are summarized here. As with most descriptive<br />

syntaxes, any use of the syntax involves certain stylistic choices. These stylistic choices are not part of<br />

UML, but nonetheless can be important to understanding the diagrams. We explain the style that we<br />

use here.<br />

A.1 Package Diagrams<br />

Figures 1.12 and 1.17 show UML package diagrams, which have a simple syntax. A package is<br />

given as a box with a tab, with the tab containing the name of the package. Subpackages are enclosed<br />

in the box of the parent package, and package dependencies are indicated with arrows. A package<br />

dependency occurs when a Java file in a package includes a class in another package (using import in<br />

Java).<br />

A.2 Static Structure Diagrams<br />

Figure 1.16 is a different kind of UML diagram, called a static structure diagram or class diagram.<br />

It represents the relationships between classes, including inheritance relationships, containment relationships,<br />

and cross references. These relationships are called an object model, and represent many<br />

essential features about the design.<br />

A.2.1 Classes<br />

A simplified static structure diagram for some Ptolemy <strong>II</strong> classes is shown in figure 1.21. In this<br />

diagram, each class is shown in a box. The class name is at the top of each box, its attributes are below<br />

that, and its methods below that. Thus, each box is divided into three segments separated by horizontal<br />

lines. The attributes are members of the Java classes, which may be public, package friendly, protected,<br />

or private. Private members are prefixed by a minus sign “-”, as for example the _container<br />

attribute of Port. Although private members are not visible directly to users of the class, they may<br />

nonetheless be a useful part of the object model because they indicate the state information contained<br />

by an instance of the class. Public members have a leading “+” and protected methods a leading “#” in<br />

a UML diagram. There are no public or protected members shown in figure 1.21. The type of a member<br />

is indicated after a colon, so for example, the _container member of Port is of type Entity.<br />

Methods, which are shown below attributes, also have a leading “+” for public, “#” for protected,<br />

and “-” for private. Our object models do not show private methods, since they are not inherited and<br />

are not visible in the interface to the object. Figure 1.21 shows a number of public methods and one<br />

protected method, _checkLink() in Port. The return type of a method is given after a colon, so for<br />

example, linkedRelationList() of Port returns a List.<br />

Although not usually included in UML diagrams, our diagrams show class constructors. They are<br />

listed first among the methods and have names that are the same as the name of the class. No return<br />

type is shown. For completeness, our object models typically show all public and protected methods of<br />

these classes, although a proper object model might only show those relevant to the issues being discussed.<br />

Figure 1.21 does not show all methods, so that we can simplify the discussion of UML. Our<br />

Heterogeneous Concurrent Modeling and Design 41

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!