4.2.2 Advanced principles

From Geostandards

Jump to: navigation, search

4.1 Introduction

4.1.1 Goal and scope of course
4.1.2 Pre-requisites: knowledge of OO-modeling, DBMS DDL/SQL and/or XML schema, specific domain/theme
4.1.3 Introduction of participants & teachers
4.1.4 Tools
4.1.5 Organization of course
4.1.6 Course reading material
4.1.7 Purpose IM: 1. enable communication, 2. built system
4.1.8 Inventory of participants' most favorite domains/themes

4.2 UML Class diagram

4.2.1 Basic principles
4.2.2 Advanced principles

4.3 Hands-on 1: basic tools

4.3.1 Explanation of initial model assignment
4.3.2 Create UML class diagram for model with 3 or 4 classes
4.3.3 Define database tables for these objects (by hand)
4.3.4 Create XML schema for these objects (by hand?)
4.3.5 Evaluation of the results
4.3.6 Use of Enterprise Architect

4.4 Frameworks

4.4.1 OGC/ISO/CEN/NEN
4.4.2 Focus on INSPIRE Generic Conceptual Model
4.4.3 GII context
4.4.4 Generic aspects: id's, references, time,etc
4.4.5 Reusable model patterns:
4.4.5.1 Topology (linear networks, partitions)
4.4.5.2 Observation data - resulting objects
4.4.5.3 Spatial object - relationship - person
4.4.6 Generic models, e.g. the 34 themes of INSPIRE

4.5 Methodology

4.5.1 User requirements, use cases
4.5.2 Inventory of available related data sets
4.5.3 Analyze the differences (data components, checklists)
4.5.4 Take initial decisions and develop model:
4.5.4.1 UML class diagram (with attributes, associations)
4.5.4.2 F&A catalogue with descriptions
4.5.4.3 Specific data types (enummerations, code lists and values)
4.5.5 Cost-benefit analysis
4.5.6 Review with stakeholders (and revise if needed)
4.5.7 Test model, develop prototype data (and revise if needed)

4.6 Example Information Model

4.6.1 xx
4.6.2 Real world example from INSPIRE cadastral parcels
4.6.3 Link to ISO 19152 LADM
4.6.4 In total 8 Categories of use cases identified
4.6.5 Closer look at 2 use cases
4.6.6 Check list with summary of all use cases
4.6.7 Conflicts of interest, feasibility
4.6.8 Vision within a model (growing options)
4.6.8.1 Optional elements (objects, attributes, associations,...)
4.6.8.2 Advanced geometries (3D, non-linear,...)
4.6.8.3 Multi-scale/representations vs. vario-scale

4.7 Hands-on 2: own model

4.7.1 Identify and create two use case descriptions
4.7.2 Go over the data components and describe needs
4.7.3 Explore information content
4.7.4 Analyze differences between needs and availables
4.7.5 Develop UML class diagram for your UML model

4.8 Implement the model

4.8.1 OMG MDA principles PIM, PSM
4.8.2 Generate implementations
4.8.3 Generic PIM - Specific PIM
4.8.3.1 - PSM1 (PostgreSQL/PostGIS) - SQL/DDL
4.8.3.2 - PSM2 (XML/GML schema) - XSD
4.8.3.3 - PSM3...
4.8.4 Run SQL/DDL within DBMS to set up model, load/create data
4.8.5 Generate XML/GML according to XSD

4.9 Adding more semantics

4.9.1 Add business rule, i.e. constraints on the data within the model
4.9.2 Classification main categories of constraint types
4.9.3 Describe in natural text using the literal entities from UML class diagrams (classes, attributes, associations)
4.9.4 Formalize the constraints into OCL (object constraint language)
4.9.5 Implementation/use of constraints ? non trivial
4.9.6.1 DBMS: either constraints views selection violations or triggers and procedures (heavy transform)
4.9.6.2 XML/XSD: literal encoding of OCL string

4.10 Hands-on 3: convert model

4.10.1 Convert model from hands-on 1 to SQL/DDL
4.10.2 Load the script into the DBMS
4.10.3 Insert data and perform some queries
4.10.4 Convert model to XML schema and inspect resulting XSD
4.10.5 Create XML data document from DBMS export to XML
4.10.6 Validate XML data against XML schema (optional)
4.10.7 Same steps as above but now for own model of hands-on 2 (with spatial data), manual corrections...

4.11 Conclusion

4.11.1 Summarize main points
4.11.2 Presentation of participants' hands-on result
4.11.3 Additional tips&tricks
4.11.4 National modeling activities (NEN3610+IMxx)
4.11.5 Discussion on model mapping
4.11.6 Further reading/studying
4.11.7 Evaluation by participants



Contents

Visibility of attributes

Visibility of attributes can be defined to what extent they are known by external objects. This is what is meant by the scope or visibility. UML has four categories with separate types of notation:

  • + public: The attribute is visible for each class that references this class
  • -private: The attribute is only visible for the class itself
  • #protected: The attribute is only visible for this class and its subclasses
  • /derived: The attribute can be derived from the rest of the model. This makes the attribute redundant.
  • ~ package: Attribute is visible for all other classes within the same package For the domain modeling in the field of geo information, as for instance seen in the Inspire data specifications, the most commonly used scope is public. The means the less restricted option.


UML Notation:

Image:Publicprivate.GIF


DataType

Datatypes are used to associate attributes with defined value formats or types. Typical datatypes are:

  • Character,
  • Integer,
  • Boolean,
  • Date.

The ISO19107 Spatial schema defines amongst others the datatypes for geometry. Examples are:

  • GM_Surface,
  • GM_Point,
  • GM_Curve,
  • GM_MultiPoint.

When defining geometry types these datatypes should be used. Datatypes are also often created by the modeler. A common use is to define complex datatypes that are a combination of several related attributes.


Enumerations

Enumerations are types of classes that contain domain values. For instance the enumeration ‘VegetationType’ can contain the defined values: forest, grass, heather. Enumerations show lists of which a value has to be chosen. The list is not extensible. CodeList are used when lists are supposed to be extensible. In the example, for the vegetationType the options are limited to ‘forest’, ‘grass’ or ‘heather’. For the types of animal ‘bear’, ‘monkey’, ‘bird’ or any other suggestion can be added.


Image:Datatype enum.GIF

Class attributes

Class attributes are used to specify properties of a class in stead of instances. In that respect can the class be considered as an object. The class attribute can have only one value. Class attributes are recognizable as underlined attributes.



Direction of association

Associations generally are not directed. Objects at both sides of an association are referenced to each other. However it can be necessary to specify that one class can find the other but not visa versa. For instance apartments might be associated to a apartment building and the building not to its separate apartments.


Image:Dirassocia.GIF


Aggregation or composition

Aggregation and composition are both special types of associations.
The aggregation specifies that one or more classes are part of another class. What the part of relation exactly implies is not specified. The composition is more strict. It is used when an object (or instance) can only be part of exactly one other object. Furthermore is there a lifetime dependency, the ‘part of object’ can never outlive the composed object. The aggregation therefore gives more freedom in use, but also provides less information and can easily be substituted by a normal association. Aggregations are therefore much avoided.


When using compositions one has to be sure that the lifetime dependency really exists. This often can be debated. An engine in car in to some has a lifetime dependency. When the car is gone the engine is gone. To others the engine can easily lead a life of its own. Two examples are given by the figure below.

Image:Aggracompo.GIF


Exclusivity {XOR}

When modeling associations or generalization-specialization relations it sometimes is needed to explicitly state that the relation is exclusive. This exclusivity constraint can be modeled using the {XOR} constraint. It indicates that only one of the relations pointed at is true at any one time. Two examples:

  • An address is either a Visiting address or a Postbox it cannot be both at the same time.
  • An inhabitant of a building is either a renter or an owner.


Image:Xor.PNG


Association class



Organization in packages

previous Information modeling next
Personal tools