A UML Meta-Model

UML models—use case models, activity models, object models, etc.-- are specified using class diagrams. These class diagrams use only a few core elements: classes, associations, generalizations.

Lab 1

Create a Star UML project called meta models. Add a package called object models containing a class diagram that shows the relationships between the following concepts:

package, class, interface, association, generalization, realization, operation, attribute, endpoint, and other stuff I'm forgetting

These are all modeled as classes with properties such as name, scope, visibility, etc. (I.e., the stuff on the property sheet in StarUML that we have been using in class.)

You may also want to introduce classes representing the following concepts:

Element (everything is an element)

Type (generalizes classes and interfaces)

Dependency (generalizes generalization, association, and realization)

Here's how my diagram begins:

Element is a convenient abstraction for all of the above concepts. Notice that it is an abstract class. There are no elements that aren't something else that's more specific. Every element has a name (of type String) and a visibility. I've added these as protected properties of Element so that they will be inherited and visible to all of the subclasses of Element. I made Visibility an enumeration with pre-defined elements so that people wouldn't go making up their own visibilities.

Lab 2

Add another package to meta models called use case models. Create a class diagram showing the relationships between the following concepts:

Note that associations and generalizations are similar to the same concepts from object models. In particular an association has two endpoints with attributes such as visibility, navigability, and multiplicity.

Lab 3

Add another package to meta models called activity models. Create a class diagram showing the relationships between the following concepts: