67
Introduction to Unified Modeling Language (UML) 3rd INSPIRATION Training December 4-5, 2012 A multi-country project funded by the European Union and implemented by INSPIRATION – Spatial Data Infrastructure in the Western Balkans

Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

  • Upload
    letuyen

  • View
    218

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Introduction to Unified Modeling Language (UML)

3rd INSPIRATION Training December 4-5, 2012

A multi-country project funded by the European Union and implemented by

INSPIRATION – Spatial Data Infrastructure in the Western Balkans

Page 2: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Content

Basic introduction

Models

UML

Diagrams

Exercises & Examples

Class diagram

Page 3: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Scope

Basic knowledge of UML

Introduction of modelling and UML

Class model introduction

& Exercises

INSPIRE Data Specification on Cadastre

Page 4: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Background

What are models?

Page 5: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Background

What are models?

A complete description of a system from a particular perspective

Simplification of reality

Page 6: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Why models?

Modeling achieves four aims: Helps you to visualize a system as you want it to be.

Permits you to specify the structure or behavior of a system.

Gives you a template that guides you in constructing a system.

Documents the decisions you have made.

You build models of complex systems because you cannot comprehend such a system in its entirety.

You build models to better understand the system you are developing.

Page 7: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Four Principles of Modeling

The model you choose influences how the problem is attacked.

Every model may be expressed at different levels of precision.

The best models are connected to reality.

No single model is sufficient.

Design Model Process Model Deployment Model

Page 8: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Background

What is UML? The OMG specification states: "The Unified Modeling Language (UML) is a graphical language for visualizing, specifying, constructing, and documenting the artifacts of a software-intensive system. The UML offers a standard way to write a system's blueprints, including conceptual things such as business processes and system functions as well as concrete things such as programming language statements, database schemas, and reusable software components."

?

Page 9: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Background

What is UML?

UML is a language (Unified Modeling Language) for models technical and graphical specification

Graphic notation to visualize models

Not a method or procedure

Managed and created by the Object Management Group

Page 10: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Background

The UML is a language for Visualizing

Specifying

Constructing

Documenting

the artifacts of a software-intensive system.

The Unified Modelling Language (UML) is an industry standard for object oriented design notation, supported by the Object Management Group (OMG).

Page 11: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Language for Visualizing

Communicating conceptual models to others is prone to error unless everyone involved speaks the same language.

There are things about a software system you can’t understand unless you build models.

An explicit model facilitates communication.

Page 12: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Language for Specifying

The UML builds models that are precise, unambiguous, and complete.

Page 13: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Language for Constructing

UML models can be directly connected to a variety of programming languages.

Maps to Java, C++, Visual Basic, and so on

Tables in a RDBMS or persistent store in an OODBMS

Permits forward engineering

Permits reverse engineering

Page 14: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Language for Documenting

The UML addresses documentation of system architecture, requirements, tests, project planning, and release management.

Use Case Diagram

Actor A

Use Case 1

Use Case 2

Use Case 3

Actor B

Class Diagram

GrpFile

read( )

open( )

create( )

fillFile( )

rep

Repository

name : char * = 0

readDoc( )

readFile( )

(from Persistence)

FileMgr

fetchDoc( )

sortByName( )

DocumentList

add( )

delete( )

Document

name : int

docid : int

numField : int

get( )

open( )

close( )

read( )

sortFileList( )

create( )

fillDocument( )

fList

1

FileList

add( )

delete( )

1

File

read( )

read() fill the

code..

Sequence Diagram

user

mainWnd fileMgr :

FileMgr

repository document :

Document

gFile

1: Doc view request ( )

2: fetchDoc( )

3: create ( )

4: create ( )

5: readDoc ( )

6: fillDocument ( )

7: readFile ( )

8: fillFile ( )

9: sortByName ( )

ƯÁ¤¹®¼¿¡ ´ëÇÑ º¸±â¸¦

»ç¿ëÀÚ°¡ ¿äûÇÑ´Ù.

ÈÀÏ°ü¸®ÀÚ´Â Àоî¿Â

¹®¼ÀÇ Á¤º¸̧ ¦ ÇØ´ç ¹®¼

°´Ã¼¿¡ ¼³Á¤À» ¿äûÇÑ´Ù.

È¸é °´Ã¼´Â ÀоîµéÀÎ

°´Ã¼µé¿¡ ´ëÇØ À̸§º°·Î

Á¤·ÄÀ» ½ÃÄÑ È¸é¿¡

º¸¿©ÁØ´Ù.

Deployment Diagram

Window95

¹®¼°ü¸®

Ŭ¶óÀ̾ðÆ®.EXE

Windows

NT

¹®¼°ü¸® ¿£Áø.EXE

Windows

NT

Windows95

Solaris

ÀÀ¿ë¼¹ö.EXE

Alpha

UNIX

IBM

Mainframe

µ¥ÀÌŸº£À̽º¼¹ö

Windows95

¹®¼°ü¸® ¾ÖÇǿ

ºÐ»ê ȯ°æÀÇ Çϵå¿þ¾î¹× ³×Æ®¿÷À ·̧ÎÀÇ Á¤º ̧ ½Ã½ºÅÛ ¿¬°á ¸ðµ¨

- À©µµ¿ì 95 : Ŭ¶óÀ̾ðÆ®

- À©µµ¿ì NT: ÀÀ¿ë¼¹ö

- À¯´Ð½º ¸Ó½Å: ÀÀ¿ë ¼¹ö ¹× µ¥ÀÌÅ ̧ ¼¹ö, Åë½Å ¼¹ö

- IBM ¸ÞÀÎÇÁ·¹ÀÓ: µ¥ÀÌÅ ̧ ¼¹ö, Åë½Å ¼¹ö

Page 15: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

History of the UML

Page 16: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Diagrams

Diagrams graphically depict a view of a part of your model.

Different diagrams represent different views of the system that you are developing.

A model element will appear on one or more diagrams.

Page 17: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Diagrams

UML 2.2

14 different types of diagrams

2 different groups

Behavior & Interaction models

Structural models

Page 18: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Diagrams

Page 19: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Key Diagrams in UML

Requirements

System Structure

System Behaviour

Use Case Diagrams

Interaction Diagrams

Activity Diagrams

State Charts

Class Diagrams

Collaboration Diagrams

Page 20: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Different diagrams of system for different people

Process View Deployment View

Logical View

Use-Case View

Implementation View

End-user

Functionality

Programmers

Software management

Performance, scalability, throughput

System integrators System topology, delivery, installation, communication

System engineering

Analysts/Designers

Structure

Page 21: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

What is a Use-Case Model?

A use-case model:

Is a model of a system’s intended functions and its environment

Serves as a contract between the customer and the developers

Contains the following diagrams:

Use case: Shows a set of use cases and actors and their relationships

Activity: Shows the flow of events within a use case

Sequence: Shows how a use case will be implemented in terms of collaborating objects

Page 22: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Use-Case Diagram

View Report Card

Student

Register for Courses

Login

Select Courses to Teach

Submit Grades

Professor

Registrar

Billing System

Maintain Professor Information

Maintain Student Information

Close Registration

Course Catalog

Page 23: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Activity Diagram

Action

A step in the flow of events

Decision

Flows split based on a guard

condition

Flow

Show the sequence of

activities

Fork

Beginning of concurrent flows

Join

End of concurrent flow

Page 24: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Activity Diagram (Example)

Synchronization

Bar (Fork)

Guard

Condition

Synchronization

Bar (Join)

Decision

Concurrent

Threads

Transition

Select Course

[ add course ]

Check Schedule

Check Pre-requisites

Assign to Course

Resolve Conflicts

Update Schedule

Delete Course

[ checks completed ] [ checks failed ]

[ delete course ]

Activity/Action

Page 25: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

What is a Design Model?

A design model:

Describes the realization of use cases in terms of design elements

Describes the design of the application

Contains the following diagrams:

Class: Shows UML classes and relationships

Component: Shows the structure of elements in the implementation model

Communication and Sequence: Show how objects and classes interact

State Machine: Shows event-driven behavior

Page 26: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Class Diagram

Class diagrams show the static structure of the

model resp. system

Classes

Attributes

Relationships to other classes

Class diagrams do not show temporal

information

INSPIRE data specifications

Page 27: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Class Diagram

Class A description of a set

of objects

Attribute Named property of

a class

Aggregation Represents a part-whole

relationship

Operation Class behavior

Generalization Shows an inheritance

relationship

Page 28: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Sequence Diagram

used to show how objects interact to

perform the behavior of all or part of a use case as part of a use-case realization

Page 29: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Sequence Diagram

Lifeline Shows the life of the object

Object/Class Shows the

object/class involved

in the interaction

Messages Show data exchanged

between objects

Execution Occurrence Shows object executing

Page 30: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Sequence Diagram (Example)

1: create schedule( )

2: get course offerings( )

3: get course offerings(for Semester)

4: get course offerings( )

6: display blank schedule( )

:RegisterForCoursesForm :RegistrationController SWTSU Catalog : CourseCatalogSystem

: Student : Course Catalog

5: display course offerings( )

Select Offerings ref

Page 31: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Sequence Diagram

Interaction Use (ref) References another interaction

Optional Fragment

(opt) Executed if guard condition

evaluates to true

Loop (loop) Executed as long as the first

guard condition

evaluates to true

Combined Fragments

Page 32: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Communication Diagram

Collaboration diagram

provide another way to show how objects interact to perform the behavior of a particular use case or a part of a use case. Where sequence diagrams emphasize the interactions of objects over time, communication diagrams are designed to emphasize the relationships between objects

Page 33: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Communication Diagram

Object/Class Shows the

object/class involved

in the interaction

Message Shows data

exchanged

between objects

Page 34: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Communication Diagram

Messages

: Student

: RegisterForCoursesForm

: RegistrationController : CourseCatalogSystem

5: display course offerings( )

6: display blank schedule( )

: Course Catalog 1: create schedule( )

2: get course offerings( )

3: get course offerings(forSemester)

4: get course offerings( )

Links

Page 35: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Component Diagram

It shows the runtime structure of the

system at the level of software

components. Components are the modular

parts of the system and are made up of

groups of related objects that are hidden

behind an external interface.

Page 36: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Component Diagram

Component Modular parts of the system

Class Included to show implementation

relationships.

Page 37: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Deployment Diagram

Deployment diagrams show the

deployment architecture of the system,

that is, which of the system’s software

artifacts reside on which pieces of

hardware.

Page 38: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Deployment Diagram

Artifact Represents a physical file

Node Represents a

physical machine

Owned Element

Relationship Shows another way of

showing nested elements

Page 39: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

How Many Diagrams?

Depends: You use diagrams to visualize the system from different

perspectives.

No complex system can be understood in its entirety from one perspective.

Diagrams are used for communication

Model elements will appear on one or more diagrams. For example, a class may appear on one or more class diagrams, be

represented in a state machine diagram, and have instances appear on a sequence diagram.

Each diagram will provide a different perspective.

Page 40: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML – Exercise

Page 41: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML – Exercise

Class diagram

INSPIRE Data Specifications

Foundation for other structure diagrams

Classification of reality

Page 42: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

The class diagram

Class (and objects)

Relationship

Package (advanced)

Interfaces (advanced)

Page 43: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

The class

Summarize a number of objects with the same behavior and semantics

Abstraction of entities

Semantic concept with common attributes and operations

Page 44: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

The class

Abstraction of entities

class Tree

«FeatureClass»

Tree

- TreeAge :int

- TreeType :char

Page 45: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

The class

Class name

Class attributes

Class operations

Page 46: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

The class attribute

Attribute name Data type

E.g.: -Integer - LongInt - Double - Char - Date - Boolean - String - Geometry - …

Page 47: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

The class operations

Attribute name Data type Expected operation input

Page 48: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Exercise #1 – The Class

Please develop/draw the class “Cadastral_Parcel”

What common characteristics (attribute: datatype) should the concept “Cadastral_Parcel” have?

class Exercise #1

«featureType»

CadastralParcel

?

Page 49: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Group 1

Class: Parcel

Attributes: Object no.

Number

Cadastral municipality

Land use

Number of building

Address

Area

Owner

Page 50: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Group 2

The same as g1, just no address

Page 51: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Exercise #1 – The Class

Multiple solutions possible

class Exercise #1

«featureType»

CadastralParcel

- Address :char

- APN :char

- Boundary :GM_Surface

- Centroid :GM_Point

Page 52: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Exercise #1 – The Class

INSPIRE Data Specifications on Cadastral

Geometry

Label

National cadastral reference

Area value (optional)

Reference Point (optional)

Page 53: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Relations

Relation?

Page 54: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Relations

Associations

Generalisations

Aggregations

Compositions

Page 55: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Associations

Implies that two classes have a relationship

General relationship connector

Target/Source roles

Cardinality

Directions

Constrains

Page 56: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Associations

class Tree

«FeatureType»

Tree

- TreeAge :int

- TreeType :char

«FeatureTyp...

Woodcutter

- Gender :char

- Name :char

+cuts

1..*

+cutted by

1..*

Page 57: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Generalisations

Indicated inheritance

Target/Source roles (e.g. isPartOf)

Cardinality

Constrains

Source inherits targets characteristic

Page 58: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Generalisations

class Tree

«FeatureType»

Tree

- TreeAge :int

- TreeType :char

«FeatureType»

Woodcutter

- LicenceNumber :int

«FeatureType»

Person

- Gender :char

- Name :char

+cuts

1..*

+cutted by

1..*Woodcutter inherits attributes from Person

Page 59: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Aggregations & Compositions

Indicates that the lower concept is part of a higher concept

Aggregation: Lower concept ISN’T necessary for existence of higher concept

Composition: Lower concept IS necessary for existence of higher concept

Page 60: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Aggregations & Compositions

class Tree

«FeatureType»

Tree

- TreeAge :int

- TreeType :char

«FeatureType»

Woodcutter

- LicenceNumber :int

«FeatureType»

Person

- Gender :char

- Name :char

«FeatureType»

Forest

«FeatureType»

Employees

+cuts

1..*

+cutted by

1..*

+isPartof

+consistsOf 1..*

+isPartOf

+has 0..*

Aggregation Composition

Page 61: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Exercise #2 – The relationship types Imagine you have 3 different classes

CadastralParcel Core class

Is part of several(!) administrative zones (different levels of hierarchy)

CadastralBoundary Indicates measured boundary of CadastralParcel

AdministrativeZone Administrative zones with different hierarchal levels which

existence doesn’t depend on CadastralParcel

Please develop diagram using relationship types and classes with (some) attributes!

Page 62: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Exercise 2

Cadastral Parcel Cadastral Boundary

Administrative Zone

Page 63: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Exercise #2 – The relationship types

Again there are multiple solutions

class Exercise #2

«featureType»

CadastralParcel

- Address :char

- ParcelNumber :char

- ... :...

«featureType»

CadastralZone

- Label :char

- ... :...

«featureType»

CadastralBoundary

- Geometry :GM_curve

- ... :...

?

Page 64: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

UML Exercise

Exercise #2 – The relationship types

There are multiple solutions

One example:

class Exercise #2

«featureType»

CadastralParcel

- Address :char

- ParcelNumber :char

- ... :...

«featureType»

AdministrativeZone

- Label :char

- Geometry :GM_surface

- ... :...

«featureType»

CadastralBoundary

- Geometry :GM_curve

- ... :...

+is border

1..2

+hasBorder

1..*

+isPartof

1..*

+Contains

0..*

Page 65: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

INSPIRE Cadastre

INSPIRE Data specifications on cadastral

http://inspire.jrc.ec.europa.eu/

Page 67: Introduction to Unified Modeling Language (UML)gfa-group.de/.../7/Introduction_to_the_Unified_Modeling_Language__UML_.pdf · Introduction to Unified Modeling Language (UML) 3rd INSPIRATION

Contact & Information

Christian Ansorge +43-(0)1-313 04/3160

[email protected]

Ivica Skender +385-(0)91-33667-120

[email protected]

69

Bečići ■ December 5, 2012