UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory UML Weekend Crash Course™ - To Parent Directory

crnarupa.singidunum.ac.rs
from crnarupa.singidunum.ac.rs More from this publisher
01.01.2015 Views

Session 1—What Is the UML 7 Table 1-1 The UML Four-layer Metamodel Architecture Layer Description Example metametamodel Defines the language for Defines the concepts MetaClass, specifying metamodels. MetaAttribute, MetaOperation, and so on. metamodel Defines the language for Defines the concepts Class, specifying a model. Attribute, Operation, Component, and so on. model Defines the language to use Defines the concepts Order, to describe a subject domain. Shipment, Product, Product ID, Buy(), and so on. user objects Defines specific subject Defines Order #74653, Shipment domain information. #87649, the product “CD-ROM 435”, the price $50.00, and so on. Starting from the bottom and working up, the user object layer is where you find a diagram, like a Sequence diagram or Object diagram, populated with the facts from the problem domain like Order #74653 that contains a line item for “CD-ROM 435” with a price of $50.00. The diagram is built following the rules defined by the next layer above it, the model layer. The model layer fully explains the classes that describe the subject domain objects, for example, classes like Order, Shipment, and Product. It tells you what an Order looks like, the fields it contains, the operations it can perform, and so on, without ever telling you about any particular Order. These class definitions conform to the rules specified in the next layer above, the metamodel (2M) layer. The metamodel (2M) layer defines what a class is so that the model layer knows how to describe the Order class. It defines a class as a concept having attributes, operations, and associations. It defines an attribute as having a name, a data type, a default value, and constraints. These definitions in turn conform to the specifications of the metametamodel (3M). The metametamodel (3M) layer is the realm of the philosophers and practitioners of the black arts who determine what makes up a language. Nearly all the definitions at this layer are abstract, that is, they are more like templates that can be used to build a wide variety of concrete concepts. In case I managed to scare you just now, relax, all you really need to know is the metamodel. That is what this entire course is about, defining the diagrams and the elements used to construct them. Once you understand the diagrams defined by the metamodel layer, you will get enough practice building the model and user object layers to become quite comfortable. The organization of the metamodel The metamodel is a bit complex, so it helps to organize the elements into packages. A package is basically the UML version of a directory, a place to put things. At the first level you

8 Friday Evening will find three packages called the Foundation, Model Management, and Behavioral Elements packages, as shown in Figure 1-1. Behavioral Elements Foundation Model Management Figure 1-1 Packages of the UML metamodel Figure 1-1 shows that Behavioral Elements and Model Management depend on the Foundation package. In other words, they won’t work properly if they don’t get help from the contents of the Foundation package (more on the Foundation package in a moment). The Behavioral Elements package contains everything you need to model behavior like Use Cases, Collaborations, Statecharts, and more. Model Management explains how to model packages, subsystems, and similar organizational structures. Figure 1-2 represents the contents of the Foundation package. The Foundation package contains four more packages, the CORE, Auxiliary Elements, Data Types, and Extension Mechanisms packages. Auxiliary Elements Core Extension Mechanisms Data Types Figure 1-2 The contents of the Foundation package The Core package defines all the fundamental concepts used in the UML diagrams like Class, Interface, Association, and Data Type. But it also defines some abstract concepts like GeneralizableElement, a high level definition for anything that can implement inheritance, like a class, a Use Case, an actor, and more. The other three packages support the Core package with items like dependencies; primitive data types like integer, string, and time; and some built-in extension mechanisms that I’ll talk about next. UML Extension Mechanisms The UML also provides some built-in extensions to the diagram notations. One such tool is called a stereotype. A stereotype appears inside of > (guillemets) and characterizes a type of element like a class or relationship without specifying its implementation. For example, you might stereotype a number of classes as to convey that

8<br />

Friday Evening<br />

will find three packages called the Foundation, Model Management, and Behavioral Elements<br />

packages, as shown in Figure 1-1.<br />

Behavioral Elements Foundation Model Management<br />

Figure 1-1 Packages of the <strong>UML</strong> metamodel<br />

Figure 1-1 shows that Behavioral Elements and Model Management depend on the<br />

Foundation package. In other words, they won’t work properly if they don’t get help from<br />

the contents of the Foundation package (more on the Foundation package in a moment).<br />

The Behavioral Elements package contains everything you need to model behavior like<br />

Use Cases, Collaborations, Statecharts, and more.<br />

Model Management explains how to model packages, subsystems, and similar organizational<br />

structures.<br />

Figure 1-2 represents the contents of the Foundation package. The Foundation package<br />

contains four more packages, the CORE, Auxiliary Elements, Data Types, and Extension<br />

Mechanisms packages.<br />

Auxiliary Elements<br />

Core<br />

Extension Mechanisms<br />

Data Types<br />

Figure 1-2 The contents of the Foundation package<br />

The Core package defines all the fundamental concepts used in the <strong>UML</strong> diagrams like<br />

Class, Interface, Association, and Data Type. But it also defines some abstract concepts like<br />

GeneralizableElement, a high level definition for anything that can implement inheritance,<br />

like a class, a Use Case, an actor, and more.<br />

The other three packages support the Core package with items like dependencies; primitive<br />

data types like integer, string, and time; and some built-in extension mechanisms that<br />

I’ll talk about next.<br />

<strong>UML</strong> Extension Mechanisms<br />

The <strong>UML</strong> also provides some built-in extensions to the diagram notations. One such tool is<br />

called a stereotype. A stereotype appears inside of > (guillemets) and characterizes a<br />

type of element like a class or relationship without specifying its implementation. For<br />

example, you might stereotype a number of classes as to convey that

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

Saved successfully!

Ooh no, something went wrong!