UML model

The UML (Unified Modeling Language) model represents a format-independent description of your data. Its primary benefit is that it defines and describes the data elements and how they are related. By using a model-based approach, the data format is more likely to be well-structured and more tolerant to modifications.

UML class relationships

The major classes in the UML (Unified Modeling Language) model are represented as major elements in your XML schema. The different types of relationships between the UML classes determine how your XML elements are structured in the schema.

There are 3 class relationships:

Directed Composition: When a class is composed of a sub-element or sub-elements. For example, if you were creating an elections report, then the election report would be composed of elections. In your XML schema, the Election element will be generated as a sub-element of the ElectionReport element.

Is a Type of or Instance of: When an abstract class implements a concrete class. For example, if you were creating a contest, then it is implemented by its concrete class. Thus, a candidate contest is a type of contest. In your XML schema, Contest will be generated as an abstract XML element and serve as an extension base to the CandidateContest element.

Directed Association: When an element includes another element that contains an identifier associated with the second element. For example, if you were associating or linking a candidate to a party. In your XML schema, the Candidate element will include a PartyId element, which will contain an identifier associated with a Party element.

The following diagram illustrates the 3 types of relationships:

UML Diagram

UML model examples

The following shows a Contest entity and two types of Contest: CandidateContest and PartyContest.

The following shows a high-level view of the class diagram for a CandidateContest:

UML Diagram

The following shows a high-level view of the class diagram for a PartyContest:

UML Diagram