UML Class Diagram

Ken Webb 2010-04-12T15:47:18Z

A UML class diagram models classes, and associations among class instances. UML 2 offers at least ten different association types to choose from.

Xholon focuses on three of these association types: generalization, composition, and aggregation. Each of these three is typically captured in a separate set of one or more XML files or strings. The Xholon Digital Watch sample includes examples of all three of these associations, each drawn on a separate UML class diagram using the Poseidon UML tool. Look for the diagrams labeled InheritanceHierarchy (generalization), ContainmentHierarchy (composition), and PortAssociations (aggregation). Note that the PortAssociations diagram uses generic associations rather than aggregation associations.

Generalization

In Java, generalization is a relationship between a subclass and its superclass, for example:

class Cat extends Mammal
In Xholon, generalization is specified in a InheritanceHierarchy.xml file or string.

Composition

In the UML 2 specification, composition is expressed as a kind of aggregation (AggregationKind = composite). It's intended to be a strong form of aggregation representing ownership of parts. In Java, there is no distinction between composition and aggregation. In Xholon, composition is specified in a CompositeStructureHierarchy.xml file or string.

Aggregation

In Java, aggregation is a reference from one object to another object, for example:

class Cat {
 Person slave;
}

In Xholon, aggregation is specified using port elements in a ClassDetails.xml file or string.

return to main page