training: inspire basics ec jrc 1/15 uml class diagram: example inspire uml class diagram for...
TRANSCRIPT
Training: INSPIRE BasicsEC JRC
1/15
UML class diagram: example
INSPIRE UML class diagram for administrative units
class Administrativ eUnits: Ov erv iew
«codeList»Administrativ eHierarchyLev el
+ 1stOrder+ 2ndOrder+ 3rdOrder+ 4thOrder+ 5thOrder+ 6thOrder
«featureType»Administrativ eBoundary
+ country :CountryCode+ geometry :GM_Curve+ inspireId :Identifier+ nationalLevel :AdministrativeHierarchyLevel [1..6]
«voidable, l ifeCycleInfo»+ beginLifespanVersion :DateTime+ endLifespanVersion :DateTime [0..1]
«voidable»+ legalStatus :LegalStatusValue = "agreed"+ technicalStatus :TechnicalStatusValue = "edge-matched"
«featureType»Administrativ eUnit
+ country :CountryCode+ geometry :GM_MultiSurface+ inspireId :Identifier+ name :GeographicalName [1..*]+ nationalCode :CharacterString+ nationalLevel :AdministrativeHierarchyLevel
«voidable, l ifeCycleInfo»+ beginLifespanVersion :DateTime+ endLifespanVersion :DateTime [0..1]
«voidable»+ nationalLevelName :LocalisedCharacterString [1..*]+ residenceOfAuthority :ResidenceOfAuthority [1..*]
constraints{CondominiumsAtCountryLevel}{AdmininstrativeUnitHighestLevel}{AdministrativeUnitLowestLevel}
«dataType»ResidenceOfAuthority
+ name :GeographicalName
«voidable»+ geometry :GM_Point
+admUnit«voidable»
1..*
+boundary«voidable»
1..*
+/administeredBy«voidable» 0..*
+coAdminister«voidable» 0..*
+lowerLevelUnit«voidable» 0..*
+upperLevelUnit«voidable» 0..1
Training: INSPIRE BasicsEC JRC
2/15
UML (Unified Modeling Language)
Training: INSPIRE BasicsEC JRC
3/15
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 BasicsEC JRC
4/15
Class
Car
+ seatNumber : Integer
+ colour : Colour [1..*]
visibility
class name (convention: UpperCamelCase)
attribute name (convention: lowerCamelCase)
attribute type
multiplicity –[min..max](default: exactly 1)
« A car is characterised by a seat number and one or several colors. »
Training: INSPIRE BasicsEC JRC
5/15
Inheritage / generalisation
• Definition: taxonomic relationship between a more general element and a more specific element.
• Representation: ClassA
ClassB
« A ClassB instance is also a ClassA instance »« ClassB instances share the same characteristics as Class A instances »« ClassB specialises ClassA »« ClassA is more abstract / generalised than ClassB »...
Training: INSPIRE BasicsEC JRC
6/15
Inheritage / generalisation
Bus
passengerNb : Integer
Vehicle
ownerName : String
Boat
draft : Float
Car
constructionDate : Date
« Cars, boats, and buses are vehicles »« All vehicles have a construction date »« A bus is a vehicle with a passenger number value »…
abstract classes(shown in italics)cannot have instances
Training: INSPIRE BasicsEC JRC
7/15
Association
ClassA ClassBc..da..b
AssotiationNameroleA roleB
Company Person0..*1..*
Employmentemployer employee
• Definition: relationship between classes that specifies connections between their instances
• Example:
Training: INSPIRE BasicsEC JRC
8/15
Multiplicity
Company Person0..*0..* Employment
employer employed
Individual
« 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 »
Kinship
« There is a kinship relation between individuals »« All individuals have exactly 2 parents »« Each individual can have no, one or several children »
parent
child
0..*
2
• Examples:
Training: INSPIRE BasicsEC JRC
9/15
Aggregation
• Definition: Aggregation relationship between instances of a class and several instances of another class
• Example:
AggregateClass AggregatedClassc..da..b
« A ClassA instance is an aggregate of instances of classB »
Country Region*1
« A country is an aggregation of regions »
Training: INSPIRE BasicsEC JRC
10/15
Composition
• Definition: Composition relationship between instances of a class and several instances of another classe (they cannot exist independently
• Example:
CompositeClass ComponantClass*1
« A classA instance is a a composite of instances of classB »
Book Page2..*1
« A book is composed of pages (at least two) »
Training: INSPIRE BasicsEC JRC
11/15
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 Person*0..2
supplier user
« 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 BasicsEC JRC
12/15
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
ClassA
Comment on classA
Training: INSPIRE BasicsEC JRC
13/15
Constraint
• Definition: condition or restriction to satisfy.• Can be represented in {…} or in a note• In natural language, or OCL (when possible)
ClassA
ClassA objects shouldbe like this {ClassA objects should
be like that}
Training: INSPIRE BasicsEC JRC
14/15
Stereotype
• Definition: Stereotypes extend the semantics, but not the structure of pre-existing UML elements (classes, attributes, operations, associations, roles, packages)
• UML representation:
<< stereotypeName >>ClassName
<< stereotypeName >>+ attributeName : DataType
Training: INSPIRE BasicsEC JRC
15/15
Exercise: What is represented here?
INSPIRE UML class diagram for administrative units
class Administrativ eUnits: Ov erv iew
«codeList»Administrativ eHierarchyLev el
+ 1stOrder+ 2ndOrder+ 3rdOrder+ 4thOrder+ 5thOrder+ 6thOrder
«featureType»Administrativ eBoundary
+ country :CountryCode+ geometry :GM_Curve+ inspireId :Identifier+ nationalLevel :AdministrativeHierarchyLevel [1..6]
«voidable, l ifeCycleInfo»+ beginLifespanVersion :DateTime+ endLifespanVersion :DateTime [0..1]
«voidable»+ legalStatus :LegalStatusValue = "agreed"+ technicalStatus :TechnicalStatusValue = "edge-matched"
«featureType»Administrativ eUnit
+ country :CountryCode+ geometry :GM_MultiSurface+ inspireId :Identifier+ name :GeographicalName [1..*]+ nationalCode :CharacterString+ nationalLevel :AdministrativeHierarchyLevel
«voidable, l ifeCycleInfo»+ beginLifespanVersion :DateTime+ endLifespanVersion :DateTime [0..1]
«voidable»+ nationalLevelName :LocalisedCharacterString [1..*]+ residenceOfAuthority :ResidenceOfAuthority [1..*]
constraints{CondominiumsAtCountryLevel}{AdmininstrativeUnitHighestLevel}{AdministrativeUnitLowestLevel}
«dataType»ResidenceOfAuthority
+ name :GeographicalName
«voidable»+ geometry :GM_Point
+admUnit«voidable»
1..*
+boundary«voidable»
1..*
+/administeredBy«voidable» 0..*
+coAdminister«voidable» 0..*
+lowerLevelUnit«voidable» 0..*
+upperLevelUnit«voidable» 0..1