Transcript Definition
EC JRC
UML class diagram: example
class Administrativ eUnits: Ov erv iew
«featureType»
Administrativ eBoundary
+ country :CountryCode + geometry :GM_Curve + inspireId :Identifier + nationalLevel :AdministrativeHierarchyLevel [1..6] «voidable, lifeCycleInfo» + beginLifespanVersion :DateTime + endLifespanVersion :DateTime [0..1] «voidable» + legalStatus :LegalStatusValue = "agreed" + technicalStatus :TechnicalStatusValue = "edge-matched" +boundary «voidable» 1..* +coAdminister «voidable» 0..* «featureType»
Administrativ eUnit
+admUnit «voidable» 1..* + country :CountryCode + geometry :GM_MultiSurface + inspireId :Identifier + name :GeographicalName [1..*] + nationalCode :CharacterString + nationalLevel :AdministrativeHierarchyLevel «voidable, lifeCycleInfo» + beginLifespanVersion :DateTime + endLifespanVersion :DateTime [0..1] «voidable» + nationalLevelName :LocalisedCharacterString [1..*] + residenceOfAuthority :ResidenceOfAuthority [1..*]
constraints
{CondominiumsAtCountryLevel} {AdmininstrativeUnitHighestLevel} {AdministrativeUnitLowestLevel} +/administeredBy «voidable» 0..* +upperLevelUnit «voidable» 0..1
+lowerLevelUnit «voidable» 0..* «codeList»
Administrativ eHierarchyLev el
+ 1stOrder + 2ndOrder + 3rdOrder + 4thOrder + 5thOrder + 6thOrder «dataType»
ResidenceOfAuthority
+ name :GeographicalName «voidable» + geometry :GM_Point 1/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, operations, relationships, and semantics.
Objects are also called «instances» of the class Training: INSPIRE Basics EC JRC 3/15
Class
class name (convention: UpperCamelCase) visibility Car + seatNumber : Integer + colour : Colour [1..*] attribute name (convention: lowerCamelCase) attribute type multiplicity – [min..max] (default: exactly 1) Training: INSPIRE Basics EC JRC « A car is characterised by a seat number and one or several colors. » 4/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 Basics 5/15 EC JRC
Inheritage / generalisation
Vehicle
ownerName : String constructionDate : Date abstract classes (shown in italics) cannot have instances Car Boat draft : Float Bus passengerNb : Integer Training: INSPIRE Basics EC JRC « Cars, boats, and buses are vehicles » « All vehicles have a construction date » « A bus is a vehicle with a passenger number value » … 6/15
Association
• Definition: relationship between classes that specifies connections between their instances ClassA roleA a..b
AssotiationName roleB c..d
ClassB •
Example:
Company employer 1..* Employment employee 0..* Person Training: INSPIRE Basics EC JRC 7/15
Multiplicity
•
Examples:
Company employer 0..* Employment employed 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 2 Individual Training: INSPIRE Basics EC JRC Kinship 0..* child « 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 another class AggregateClass c..d
AggregatedClass a..b
« A ClassA instance is an aggregate of instances of classB » •
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 another classe (they cannot exist independently CompositeClass ComponantClass 1 * « A classA instance is a a composite of instances of classB » •
Example:
Book Page 1 2..* « 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 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 linked to the element it is related to (with dashed line) In natural language ClassA Comment on classA Training: INSPIRE Basics EC JRC 12/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 should be like this {ClassA objects should be like that} Training: INSPIRE Basics EC JRC 13/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 Basics EC JRC 14/15
EC JRC
Exercise: What is represented here?
class Administrativ eUnits: Ov erv iew
«featureType»
Administrativ eBoundary
+ country :CountryCode + geometry :GM_Curve + inspireId :Identifier + nationalLevel :AdministrativeHierarchyLevel [1..6] «voidable, lifeCycleInfo» + beginLifespanVersion :DateTime + endLifespanVersion :DateTime [0..1] «voidable» + legalStatus :LegalStatusValue = "agreed" + technicalStatus :TechnicalStatusValue = "edge-matched" +boundary «voidable» 1..* +coAdminister «voidable» 0..* «featureType»
Administrativ eUnit
+admUnit «voidable» 1..* + country :CountryCode + geometry :GM_MultiSurface + inspireId :Identifier + name :GeographicalName [1..*] + nationalCode :CharacterString + nationalLevel :AdministrativeHierarchyLevel «voidable, lifeCycleInfo» + beginLifespanVersion :DateTime + endLifespanVersion :DateTime [0..1] «voidable» + nationalLevelName :LocalisedCharacterString [1..*] + residenceOfAuthority :ResidenceOfAuthority [1..*]
constraints
{CondominiumsAtCountryLevel} {AdmininstrativeUnitHighestLevel} {AdministrativeUnitLowestLevel} +/administeredBy «voidable» 0..* +upperLevelUnit «voidable» 0..1
+lowerLevelUnit «voidable» 0..* «codeList»
Administrativ eHierarchyLev el
+ 1stOrder + 2ndOrder + 3rdOrder + 4thOrder + 5thOrder + 6thOrder «dataType»
ResidenceOfAuthority
+ name :GeographicalName «voidable» + geometry :GM_Point 15/15