M2 UML Class Diagram
A metamodel for UML class diagrams — the most widely used notation for modelling software structure, data models, and type hierarchies.
Element Types (4)
Section titled “Element Types (4)”Classifiers Layer
Section titled “Classifiers Layer”| Type | Shape | Colour | Description |
|---|---|---|---|
| Class | rectangle | #B5D4FF (light blue) | A UML class with name, attribute, and operation compartments |
| Interface | rectangle | #D4E8FF (lighter blue) | A UML interface — a contract defining operations |
| Attribute | rectangle (subordinate) | #D4E8FF | A typed property owned by a Class. Renders inside the attributes compartment |
| Operation | rectangle (subordinate) | #D4E8FF | A behaviour owned by a Class or Interface. Renders inside the operations compartment |
Compartments
Section titled “Compartments”Class renders with three compartments:
- Name — class name in bold
- Attributes — owned Attribute elements displayed as
{name} : {Type}{Visibility? [{Visibility}]:} - Operations — owned Operation elements
Interface renders similarly but with a <<interface>> stereotype.
Properties
Section titled “Properties”Attribute:
- Type (enumeration: String, Integer, Real, Boolean, Date, DateTime, Text)
- Visibility (enumeration: public, private, protected, package)
- Is Static (Boolean)
Operation:
- Return Type (String)
- Visibility (enumeration)
Relationship Types (5)
Section titled “Relationship Types (5)”| Relationship | Line Style | Markers | Description |
|---|---|---|---|
| Association | solid | none | General connection between classifiers |
| Composition | solid | filled diamond at source | Strong ownership — part is destroyed with the whole |
| Generalization | solid | hollow arrow at target | Inheritance / “is a” |
| Realization | dashed | hollow arrow at target | Implements an interface |
| Dependency | dashed | arrow at target | One element depends on another |
Enumerations (1)
Section titled “Enumerations (1)”UML Visibility — public, private, protected, package
Export
Section titled “Export”UML models can be exported to XMI 2.5.1 via File > Export XMI and to Eclipse EMF (.ecore + .xmi) via File > Export for Eclipse EMF.