UML class diagram example INSPIRE UML class diagram

  • Slides: 15
Download presentation
UML class diagram: example INSPIRE UML class diagram for administrative units Training: INSPIRE Basics

UML class diagram: example INSPIRE UML class diagram for administrative units Training: INSPIRE Basics EC JRC 1/15

UML (Unified Modeling Language) Training: INSPIRE Basics EC JRC 2/15

UML (Unified Modeling Language) Training: INSPIRE Basics EC JRC 2/15

Class • Definition: description of a set of objects that share the same attributes,

Class • Definition: description of a set of objects that share the same attributes, operations, relationships, and semantics. • Objects are also called «instances» of the class Training: INSPIRE Basics EC JRC 3/15

Class visibility class name (convention: Upper. Camel. Case) Car + seat. Number : Integer

Class visibility class name (convention: Upper. Camel. Case) Car + seat. Number : Integer + colour : Colour [1. . *] attribute name (convention: lower. Camel. Case) attribute type multiplicity – [min. . max] (default: exactly 1) « A car is characterised by a seat number and one or several colors. » Training: INSPIRE Basics EC JRC 4/15

Inheritage / generalisation • Definition: taxonomic relationship between a more general element and a

Inheritage / generalisation • Definition: taxonomic relationship between a more general element and a more specific element. • Representation: Class. A Class. B « A Class. B instance is also a Class. A instance » « Class. B instances share the same characteristics as Class A instances » « Class. B specialises Class. A » « Class. A is more abstract / generalised than Class. B » . . . Training: INSPIRE Basics EC JRC 5/15

Inheritage / generalisation Vehicle owner. Name : String construction. Date : Date Car Boat

Inheritage / generalisation Vehicle owner. Name : String construction. Date : Date Car Boat draft : Float abstract classes (shown in italics) cannot have instances Bus passenger. Nb : Integer « Cars, boats, and buses are vehicles » « All vehicles have a construction date » « A bus is a vehicle with a passenger number value » … Training: INSPIRE Basics EC JRC 6/15

Association • Definition: relationship between classes that specifies connections between their instances Class. A

Association • Definition: relationship between classes that specifies connections between their instances Class. A role. A a. . b Assotiation. Name role. B c. . d Class. B • Example: Company Training: INSPIRE Basics EC JRC employer 1. . * Employment employee 0. . * Person 7/15

Multiplicity • Examples: Company employed employer Employment 0. . * Person « Companies and

Multiplicity • Examples: Company employed employer Employment 0. . * Person « Companies and persons are linked with an employment relation » « A person can be employed by zero, one or several companies » « A company can employ zero, one or several persons » parent Kinship 2 Individual 0. . * child Training: INSPIRE Basics EC JRC « There is a kinship relation between individuals » « All individuals have exactly 2 parents » « Each individual can have no, one or several children » 8/15

Aggregation • Definition: Aggregation relationship between instances of a class and several instances of

Aggregation • Definition: Aggregation relationship between instances of a class and several instances of another class Aggregate. Class a. . b c. . d Aggregated. Class « A Class. A instance is an aggregate of instances of class. B » • Example: Country Region * 1 « A country is an aggregation of regions » Training: INSPIRE Basics EC JRC 9/15

Composition • Definition: Composition relationship between instances of a class and several instances of

Composition • Definition: Composition relationship between instances of a class and several instances of another classe (they cannot exist independently Composite. Class Componant. Class 1 * « A class. A instance is a a composite of instances of class. B » • Example: Book 1 2. . * Page « A book is composed of pages (at least two) » Training: INSPIRE Basics EC JRC 10/15

Navigability • Definition: Indication, whether instances of one class can see or know about

Navigability • Definition: Indication, whether instances of one class can see or know about instances of another class to which they are related through an association Company supplier 0. . 2 user * Person « A Person instance knows the Company instances it is associated with » « A Company instance does not know the Person instances it is associated with » Training: INSPIRE Basics EC JRC 11/15

Note • Definition: Comment or a constraint attached to a diagram element. • Usually

Note • Definition: Comment or a constraint attached to a diagram element. • Usually linked to the element it is related to (with dashed line) • In natural language Class. A Comment on class. A Training: INSPIRE Basics EC JRC 12/15

Constraint • Definition: condition or restriction to satisfy. • Can be represented in {…}

Constraint • Definition: condition or restriction to satisfy. • Can be represented in {…} or in a note • In natural language, or OCL (when possible) Class. A objects should be like this Training: INSPIRE Basics EC JRC {Class. A objects should be like that} 13/15

Stereotype • Definition: Stereotypes extend the semantics, but not the structure of pre-existing UML

Stereotype • Definition: Stereotypes extend the semantics, but not the structure of pre-existing UML elements (classes, attributes, operations, associations, roles, packages) • UML representation: << stereotype. Name >> Class. Name << stereotype. Name >> + attribute. Name : Data. Type Training: INSPIRE Basics EC JRC 14/15

Exercise: What is represented here? INSPIRE UML class diagram for administrative units Training: INSPIRE

Exercise: What is represented here? INSPIRE UML class diagram for administrative units Training: INSPIRE Basics EC JRC 15/15