Skip to end of metadata
Go to start of metadata

The Unified Modeling Language (UML) is a standard tool for documenting, designing, and analyzing object-oriented (OO) systems. The language is primarily graphical, and is considered a higher-level abstraction than specific OO programming languages such as C++ or Java. This is a cheat-sheet for some of the conventions used on this wiki.

Note that we aren't using any type of code-generation or round-trip engineering that many UML tools support. For this reason we can be rather lax with our use of the language. (But also keep in mind that since we don't have automation in the process, the diagrams can quickly become out of date!)

A single UML model can consist of any number of diagrams, from among up to 14 different types. Each diagram is considered to belong to one of two views: static (also known as structural) or dynamic (aka. behavioral). Static views include the well-known class diagram, the component diagram, the deployment diagram, and others. The dynamic views include state machine diagram, activity diagram, sequence diagram, and others. A given UML model may have multiple diagrams of a given type, and may omit diagrams of some types.

We tend to use the Class Diagram and the Sequence Diagram the most, so we'll focus on those at this time. The Class Diagram shows inheritance, composition and other static relationships among classes and types. Sequence diagrams show the sequencing (cause and effect) behaviors among different objects, and become particularly useful in distributed systems to define component-level interactions.

Class Diagram

Here are some of the common symbols and meanings found on a Class Diagram.

The Class symbol (the boxes) can be annotated with a stereotype tag. Stereotypes can used for almost anything, but are most commonly used for denoting a well-know role of a common design pattern (ex: <<singleton>> ), or for denoting an interface as opposed to a class. An interface defines a syntactic contract for communication with a component separate from the implementation of the component, a concept which maps to the Java and C# constructs of interface, or in C++ to a class that consists of only pure, virtual methods. Note that on the Class Diagram, interfaces may inherit from one another, but classes "realize" (i.e. implement) interfaces.

Sequence Diagram

Sequence diagrams are one of the key types of behavioral diagrams in UML. They show interactions between objects, and can show activation periods in response to stimulus, and resultant interactions.

  • No labels