1 Part 2 Introduction to Unified Modeling Language UML
Levels of modelling 2 Conceptual Model Formally describes the content and structure of a data set Describes the Universe of Discourse: a view on the real-world, depending on the aimed application(s) Is software/platform independent Is generally described using a graphical conceptual language (e.g. UML)
Levels of modelling 3 Logical Model Closer to implementation, but still emphasis on information content and how it is structured, constraints, etc... Physical storage Model How it is actually stored/encoded (detailed instructions), also indexes, table spaces, binary compression methods, etc...
Levels of modelling 4
UML basics (acknowledgement goes to Julien Gaffuri DG JRC) 5 Purpose of slides: give basis to read INSPIRE UML class diagrams. Notions: Class, Attribute, Operation, Association, Constraint, Package, Stereotype...
UML class diagram 6 INSPIRE UML class diagram for administrative units
Class 7 Definition: description of a set of objects that share the same attributes, operations, relationships, and semantics.
Class 8 UML representation: Simple view ClassName Full view ClassName + AttributeName : DataType... + OperationName(parameter1Name : DataType) : outdatatype...
Class: Attribute 9 Definition: characteristic common to all the objects of a class. visibility name [multiplicity] : data-type = value Visibility: + (public) or (private) (always + in INSPIRE) Multiplicity: number of values (optional) Value: possible default values (optional)
Class: Operation 10 Definition: An operation (or method) is a service that can be requested from an object. visibility name (parameters): outdatatype parameters: list of parameters (a parameter = a name + a data type)
Class 11 Example: Car + seatnumber : int + color [1..*] : Col + repair(tool : Tool) : Bill + wash() : void «A car is characterised by a seat number and one or several colours.» «A car can be repaired. This operation returns a bill to pay» «A car can be washed»
Inheritage / generalisation 12 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»...
Inheritage / generalisation 13 Example: Vehicule ownername : String constructiondate : Date Car Boat draft : float Bus passengernb : int «Cars, boats, and buses are vehicules» «All vehicules have a construction date» «A bus is a vehicule with a passenger number value»
Association 14 Definition: relationship between classes that specifies connections between their instances. ClassA rolea 0..2 AssociationName roleb * ClassB Example: Company employer 1..* Employment employed 0..* Person
Multiplicity-Cardinality 15 Definition: number of instances of a class that may be associated with a class at the other end of the association. Possible values: Fixed: 1, 2, n, etc. Any: * Several: 0,1, 0,2,4 Within an interval: 0..1, 0..*, 1..*, etc.
Multiplicity-Cardinality 16 Examples: Company employer 1..* Employment employed 0..* Person «Companies and persons are linked with an employment relation» «A person can be employed by several companies» «A compagny has to employ at least one person» parent 2 Individual 0..* child Kinship «There is a kinship relation between individuals» «All individuals have exactly 2 parents» «Each individual can have several children»
Aggregation 17 Definition: Aggregation relationship between instances of a class and several instances of another class AggregateClass 0..2 * AggregatedClass «A classa instance is a an aggregate of instances of classb» Example: Country 1 * Region «A country is an aggregation of regions»
Composition 18 Definition: Composition relationship between instances of a class and several instances of another class (they cannot exist independently) CompositeClass ComponantClass 0..2 * «A classa instance is a a composite of instances of classb» Example: Book 0..1 2..* Page «A book is composed of pages (at least two)»
Navigability 19 Definition: Indication on the navigation supported by an association ClassA supplier 0..2 user * ClassB «A classb instance knows the classa instances it is associated with» «It is not necessary to retrieve ClassB instances linked to a ClassA instance»
Note 20 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
Constraint 21 Definition: condition or restriction to satisfy. Can be represented in { } or in a note In natural language, or OCL (when possible) OCL = Object Constraint Language ClassA ClassA objects should be like this {ClassA objects should be like that}
Package 22 Definition: A package is a set of classes Defined according to some needs of decomposition of UML models. UML representations: PackageX PackageX ClassA ClassB ClassA 0..2 * ClassB PackageX
Package diagram 23 Definition: representation of the relations between packages. Provides a higher level of abstraction.
Package diagram 24 INSPIRE package diagram for administrative units
Stereotype 25 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
Stereotype 26 Examples: <<DataType>>: set of values without identity <<Enumeration>>: data type with named literal values (ex: Boolean TRUE, FALSE) <<CodeList>>: extendable enumeration
Stereotype 27 INSPIRE stereotypes: <<FeatureType>>: for spatial object classes. <<Voidable>>: element that may not be present <<PlaceHolder>>: class that will be specified in the future
What is it? 28 INSPIRE UML class diagram for administrative units
Example 29 CityModel Usage: string * Owner Identification: string Building Type: string Parcel Parcel ID: string Area: float * Name: string Adress: string Private company Type: string NumberOfEmpl: integer Private person IncomeTax: float
30 30
Nesting vs normalisation 31 UML diagrams often explains nested structures (complex in XML) Most databases are normalised Simple structures (simple XML files) Independent tables (more or less) The same conceptual model can be implemented in various ways Can we transform a XML file from one schema to another?