The UML Meta-Model

The UML specification [UML-OMG] is insanely complex and filled with inconsistencies. Basically, the specification uses UML to specify UML. Thus, the specification is sometimes referred to as the UML Meta-Model. I'm not sure it's worth studying the specification in too much detail unless one is building a commercial tool for processing UML diagrams.

[UML-KF] has done a good job of summarizing the specification here:

http://www.uml-diagrams.org/uml-meta-models.html

Meta-models

The Object Management Group (OMG) is in the business of specifying standards for object-oriented developers—modeling standards (like UML), middleware standards (like CORBA), data warehousing standards (like SAS), etc.

Here's my simplified summary of the OMG specifications:

There are three levels of abstraction in the OMG specifications:

M1 = Models (i.e., models created by UML users)

M2 = Meta-Models, M1 models are instances of M2 models = {UML, CWM}

M3 = Meta-Meta-Models, M2 models are instances of M3 models = {MOF}

The Meta Object Facility (MOF) was originally a CORBA type system. It is used for defining meta-models. MOF is to domain models what EBNF is to grammars. MOF could be used to define web services as well as OO concepts.

UML and CWM are M2 meta-models that instantiate MOF.

Core + UML

All of the OMG specifications depend on a tiny core of modeling concepts. [UML-KF] describes these here:

http://www.uml-diagrams.org/uml-core.html

Here's my simplified version:

Everything that appears in a UML diagram is an element. The two most important types of elements are relationships (arrows) and classifiers (nodes).

A classifier represents a set of instances. Examples of classifiers include classes, interfaces, packages, components, use cases, actors, data types (primitive types and enumerations), associations, and collaborations. An instance of a class or interface is an object, an instance of an association is a link. A classifier can have structural and behavioral features. For a class these would correspond to attributes and operations.

A directed relationship has a source element and a target element. Dependencies, generalizations, and realizations are types of directed relationships.

An (binary) association represents a semantic relationship between (two) classes. A semantic relationship is a relationship is a domain-significant relationship. For example, there could be many relationships between two people—teacher/student, parent/child, employee/dependent, etc. But in a genealogy model, for example, we are probably only interested in the parent/child relationship.

An instance of a parent/child association would be a link connecting an instance of person representing a parent to an instance of person representing one of the parent's children. For example:

Here are a few more examples:

 

A classifier can have many features. Features can be structural or behavioral. Attributes are examples of structural features for a class (e.g., an account's balance). Operations are examples of behavioral features for a class (e.g., deposit and withdraw for accounts).

Behaviors

A behaviored classifier is one that can be associated with one or more behaviors. An instance of the classifier (called the host) executes a behavior. A behavioral feature such as an operation is associated with a behavior representing the operations implementation. This behavior is executed when the operation is invoked.

There are four basic types of behaviors:

 

An opaque behavior is one with implementation-specific semantics, like a block of C++ code.

State Machine Behaviors

Some objects have well defined lifecycles which can be described using a state machine, For example, the lifecycle of a process:

 

Usually the behavior of an operation is opaque, given by some language-specific block of code. In some cases the behavior could be specified by a state machine. As an example, assume Interpreter is a class with a read-execute-print loop method that perpetually prompts a user for a command, executes the command, then prints the result.

The repl() operation could be associated with a state machine behavior:

In a state machine arrows represent transitions between states (and are a form of directed relationship). States and transitions can also have behaviors. For example, when a classifier instance is in a state it may execute behaviors upon entry, while in the state, and upon exiting the state. These behaviors can be activities, state machines, interactions, or opaque.

A transition is triggered by an event (signal, message, change, or time). A transition may have a Boolean guard that must be satisfied before the transition occurs. In addition, the transition may have execute several behaviors (called effects).

Activities

Activities can be composite or simple. A simple activity is called an action. A composite activity consists of activity or action nodes connected by control flow arrows (another type of directed relationship).

For example, the following ATM machine activity consists of four actions (not counting the decision nodes):

Kinds of actions include: create, destroy, read, write, insert, delete, send signal, receive signal, trigger event, accept event, timing event, and opaque. In the example above display menu might be a write action while get selection might be a read action.

Events

The execution of a behavior is triggered by an event.

A time even occurs at a specified time. A timeout is an example.

A message event means the classifier instance has received a message such as a method call.

A change event means some object has changed state.

A signal even is the reception of an asynchronous broadcast signal.

References

[UML-KF] The Unified Modeling Language; Kirill Fakhroutdinov; http://www.uml-diagrams.org/.

[UML-OMG] OMG Unified Modeling Language; http://www.omg.org/spec/UML/ .