Lecture 11: Structural Software Modelling 2018-06-14 Prof. Dr. - - PDF document

lecture 11 structural software modelling
SMART_READER_LITE
LIVE PREVIEW

Lecture 11: Structural Software Modelling 2018-06-14 Prof. Dr. - - PDF document

Softwaretechnik / Software-Engineering Lecture 11: Structural Software Modelling 2018-06-14 Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universitt Freiburg, Germany 11 2018-06-14 main Topic Area Architecture


slide-1
SLIDE 1

– 11 – 2018-06-14 – main –

Softwaretechnik / Software-Engineering

Lecture 11: Structural Software Modelling

2018-06-14

  • Prof. Dr. Andreas Podelski, Dr. Bernd Westphal

Albert-Ludwigs-Universität Freiburg, Germany

Topic Area Architecture & Design: Content

– 11 – 2018-06-14 – Sblockcontent –

2/55

  • Introduction and Vocabulary
  • Software Modelling
  • model; views / viewpoints; 4+1 view
  • Modelling structure
  • (simplified) class & object diagrams
  • (simplified) object constraint logic (OCL)
  • Principles of Design
  • modularity, separation of concerns
  • information hiding and data encapsulation
  • abstract data types, object orientation
  • Design Patterns
  • Modelling behaviour
  • communicating finite automata (CFA)
  • Uppaal query language
  • CFA vs. Software
  • Unified Modelling Language (UML)
  • basic state-machines
  • an outlook on hierarchical state-machines
  • Model-driven/-based Software Engineering

VL 11 . . . VL 12 . . . VL 13 . . . VL 14 . . .

slide-2
SLIDE 2

Content

– 11 – 2018-06-14 – Scontent –

3/55

  • Vocabulary
  • System, Architecture, Design
  • Software Modelling
  • views & viewpoints
  • the 4+1 view
  • Class Diagrams
  • concrete syntax,
  • abstract syntax,
  • class diagrams at work,
  • semantics: system states.
  • Object Diagrams
  • concrete syntax,
  • dangling references,
  • partial vs. complete,
  • object diagrams at work.

Vocabulary

– 11 – 2018-06-14 – main –

4/55

slide-3
SLIDE 3

– 11 – 2018-06-14 – Sdesintro –

5/55

Authorized licensed use limited to: UNIVERSITAET FREIBURG. Downloaded on April 03,2015 at 13:47:32 UTC from IEEE Xplore. Restrictions apply.

Vocabulary

– 11 – 2018-06-14 – Sdesintro –

6/55

system— A collection of components organized to accomplish a specific function or set of functions. IEEE 1471 (2000) software system— A set of software units and their relations, if they together serve a common purpose. This purpose is in general complex, it usually includes, next to providing one (or more) executable program(s), also the organisation, usage, maintenance, and further development. (Ludewig and Lichter, 2013) component— One of the parts that make up a system. A component may be hardware or software and may be subdivided into other components. IEEE 610.12 (1990) software component— An architectural entity that (1) encapsulates a subset of the system’s functionality and/ or data, (2) restricts access to that subset via an explicitly defined interface, and (3) has explicitly defined dependencies on its required execution context. (Taylor et al., 2010)

slide-4
SLIDE 4

Vocabulary Cont’d

– 11 – 2018-06-14 – Sdesintro –

7/55

module— (1) A program unit that is discrete and identifiable with respect to compiling, combining with other units, and loading; for example, the input to, or output from an assembler, compiler, linkage editor, or executive routine. (2) A logically separable part of a program. IEEE 610.12 (1990) module— A set of operations and data visible from the outside only in so far as explicitly permitted by the programmers. (Ludewig and Lichter, 2013) interface— A boundary across which two independent entities meet and interact or communicate with each other. (Bachmann et al., 2002) interface (of component)— The boundary between two communicating components. The interface

  • f a component provides the services of the component to the component’s environment and/or

requires services needed by the component from the requirement. (Ludewig and Lichter, 2013)

Even More Vocabulary

– 11 – 2018-06-14 – Sdesintro –

8/55

design— (1) The process of defining the architecture, components, interfaces, and other characteristics of a system or component. (2) The result of the process in (1). IEEE 610.12 (1990) architecture— The fundamental organization of a system embodied in its components, their rela- tionships to each other and to the environment, and the principles guiding its design and evolution. IEEE 1471 (2000) software architecture— The software architecture of a program or computing system is the structure

  • r structures of the system which comprise software elements, the externally visible properties of

those elements, and the relationships among them. (Bass et al., 2003) architectural description— A model – document, product or other artifact – to communicate and record a system’s architecture. An architectural description conveys a set of views each of which depicts the system by describing domain concerns. (Ellis et al., 1996)

slide-5
SLIDE 5

Once Again, Please

– 11 – 2018-06-14 – Sdesintro –

9/55 System Software System Component Software Component Module Interface Component Interface

consists of 1 or more " is a is a may be a has is an

Software Architecture Architecture Architectural Description Design

software architecture — The software architecture of a program or computing system is the structure or structures of the system which comprise software elements, the externally visi- ble properties of those elements, and the relationships among them.

(Bass et al., 2003)

is an is described by is the result of

Goals and Relevance of Design

– 11 – 2018-06-14 – Sdesintro –

10/55

  • The structure of something is the set of relations between its parts.
  • Something not built from (recognisable) parts is called unstructured.

Design... (i) structures a system into manageable units (yields software architecture), (ii) determines the approach for realising the required software, (iii) provides hierarchical structuring into a manageable number of units at each hierarchy level. Oversimplified process model “Design”:

req. design design arch. designer

design

module spec. impl. impl. code programmer

implementation

slide-6
SLIDE 6

Content

– 11 – 2018-06-14 – Scontent –

11/55

  • Vocabulary
  • System, Architecture, Design
  • Software Modelling
  • views & viewpoints
  • the 4+1 view
  • Class Diagrams
  • concrete syntax,
  • abstract syntax,
  • class diagrams at work,
  • semantics: system states.
  • Object Diagrams
  • concrete syntax,
  • dangling references,
  • partial vs. complete,
  • object diagrams at work.

Modelling

– 11 – 2018-06-14 – main –

12/55

slide-7
SLIDE 7

Model

– 11 – 2018-06-14 – Smodel –

13/55

  • Definition. (Folk) A model is an abstract, formal, mathematical representation or description
  • f structure or behaviour of a (software) system.
  • Definition. (Glinz, 2008, 425)

A model is a concrete or mental image (Abbild) of something

  • r a concrete or mental archetype (Vorbild) for something.

Three properties are constituent: (i) the image attribute (Abbildungsmerkmal), i.e. there is an entity (called original) whose image or archetype the model is, (ii) the reduction attribute (Verkürzungsmerkmal), i.e. only those attributes of the original that are relevant in the modelling context are represented, (iii) the pragmatic attribute, i.e. the model is built in a specific context for a specific purpose.

Example: Design-Models in Construction Engineering

– 11 – 2018-06-14 – Smodel –

14/55

  • 1. Requirements
  • Shall fit on given

piece of land.

  • Each room shall

have a door.

  • Furniture shall fit

into living room.

  • Bathroom shall

have a window.

  • Cost shall be in

budget.

  • 2. Designmodel

http://wikimedia.org (CC nc-sa 3.0, Ottoklages)

  • 3. System

http://wikimedia.org (CC nc-sa 3.0, Bobthebuilder82)

Observation (1): Floorplan abstracts from certain system properties, e.g. ...

  • kind, number, and placement of bricks,
  • subsystem details (e.g., window style),
  • water pipes/wiring, and
  • wall decoration

→ architects can efficiently work on appropriate level of abstraction

slide-8
SLIDE 8

Example: Design-Models in Construction Engineering

– 11 – 2018-06-14 – Smodel –

14/55

  • 1. Requirements
  • Shall fit on given

piece of land.

  • Each room shall

have a door.

  • Furniture shall fit

into living room.

  • Bathroom shall

have a window.

  • Cost shall be in

budget.

  • 2. Designmodel

http://wikimedia.org (CC nc-sa 3.0, Ottoklages)

  • 3. System

http://wikimedia.org (CC nc-sa 3.0, Bobthebuilder82)

Observation (2): Floorplan preserves/determines certain system properties, e.g.,

  • house and room extensions (to scale),
  • presence/absence of windows and doors,
  • placement of subsystems

(such as windows). → find design errors before building the system (e.g. bathroom windows)

slide-9
SLIDE 9

Software Modelling

– 11 – 2018-06-14 – main –

16/55

Examples for Software Models?

– 11 – 2018-06-14 – Sswmodel –

17/55

From Building Blocks to Process (And Back)

– 4 – 2018-04-30 – Sptopm – 34/49 M
  • coding
coding M
  • spec. of M
prg prg . . . M testing testing rep: M / tests for M tst M1
  • .
. . Mn
  • M1, . . . , Mn
ready? M1, . . . , Mn ready? decision mgr M1
  • .
. . Mn
  • integrate
integrate decision S int

Building Blocks Plan

code B code B B... test B test B B...
  • spec. of B
tests for B A, B ready? A, B ready? decision integrate integrate S
  • spec. of A
tests for A code A code A A... test A test A A... prg tst prg prg tst mgr int code B code B B...
  • rev. 139.
test B test B B...
  • rev. 139.
  • spec. of B
tests for B A, B ready? A, B ready? decision integrate integrate S
  • spec. of A
tests for A code A code A A...
  • rev. 127.
test A test A A...
  • rev. 127.
  • code A
code A A...
  • rev. 254.
test A test A A...
  • rev. 254.
  • prg
tst prg prg tst prg tst mgr int

Process

Example: Vending Machine

– 10 – 2018-06-11 – Spcatwork –

40/60

  • Requirement: Buy Water
LSC: buy water AC: true AM: invariant I: strict User CoinValidator ChoicePanel Dispenser C50 p W A T E R ¬(C50! E1! pSOFT! pTEA! pFILLUP!) water_in_stock dWATER OK ¬(dSoft! dTEA!)

We (only) accept the software if, (i) Whenever we insert 0.50 e, (ii) and press the ‘water’ button (and no other button), (iii) and there is water in stock, (iv) then we get water (and nothing else).

  • Negative scenario: A Drink for Free

LSC:

  • nly one drink

AC: true AM: invariant I: permissive User

  • Vend. Ma.
E1 pSOFT SOFT SOFT ¬C50! ¬E1! false

We don’t accept the software if it is possible to get a drink for free.

(i) Insert one 1 euro coin. (ii) Press the ‘softdrink’ button. (iii) Do not insert any more money. (iv) Get two softdrinks.

slide-10
SLIDE 10

Views and Viewpoints

– 11 – 2018-06-14 – Sswmodel –

18/55 view — A representation of a whole system from the perspective of a related set of concerns.

IEEE 1471 (2000)

viewpoint — A specification of the conventions for constructing and using a view. A pat- tern or template from which to develop individual views by establishing the purposes and audience for a view and the techniques for its creation and analysis.

IEEE 1471 (2000)

  • A perspective is determined by concerns and information needs:
  • team leader, e.g., needs to know which team is working on what component,
  • operator, e.g., needs to know which component is running on which host,
  • developer, e.g., needs to know interfaces of other components.
  • etc.

An Early Proposal: The 4+1 View (Kruchten, 1995)

– 11 – 2018-06-14 – Sswmodel –

19/55

Logical View Development View Process View Physical View Scenarios

end-user functionality programmers, software management integrators, performance, scalability system engineers, topology, communication

Newer proposals (Ludewig and Lichter, 2013): system view: how is the system under development integrated into (or seen by) its environment; with which other systems (including users) does it interact how. static view (∼ developer view): components of the architecture, their interfaces and relations. Possibly: assignment of development, test, etc. onto teams. dynamic view (∼ process view): how and when are components instantiated and how do they work together at runtime. deployment view (∼ physical view): how are component instances mapped onto infrastructure and hardware units.

“Purpose of architecture: support functionality; functionality is not part of the architecture.” ?!

slide-11
SLIDE 11

Deployment / Physical View

– 11 – 2018-06-14 – Sswmodel –

20/55

http://products.bosch-mobility-solutions.com/en/de/driving_safety/ driving_safety_systems_for_commercial_vehicles/electronic_systems_1/ electronic_systems_3.html — Robert Bosch GmbH

Example: modern cars

  • large number of electronic control units (ECUs) spread all over the car,
  • which part of the overall software is running on which ECU?
  • which function is used when? Event triggered, time triggered, continuous, etc.?

For, e.g., a simple smartphone app, process and physical view may be trivial or determined by the employed framework (→ later) — so no need for (extensive) particular documentation.

Structure vs. Behaviour / Constructive vs. Reflective

– 11 – 2018-06-14 – Sswmodel –

21/55

  • Definition. Software is a finite description S of a (possibly in-

finite) set S of (finite or infinite) computation paths of the form σ0

α1

− − → σ1

α2

− − → σ2 · · · where

  • σi ∈ Σ, i ∈ N0, is called state (or configuration), and
  • αi ∈ A, i ∈ N0, is called action (or event).

The (possibly partial) function · : S → S is called inter- pretation of S.

  • Form of the states in Σ (and actions in A):

structure of S

  • Computation paths π of S:

behaviour of S

slide-12
SLIDE 12

Structure vs. Behaviour / Constructive vs. Reflective

– 11 – 2018-06-14 – Sswmodel –

21/55

  • Definition. Software is a finite description S of a (possibly in-

finite) set S of (finite or infinite) computation paths of the form σ0

α1

− − → σ1

α2

− − → σ2 · · · where

  • σi ∈ Σ, i ∈ N0, is called state (or configuration), and
  • αi ∈ A, i ∈ N0, is called action (or event).

The (possibly partial) function · : S → S is called inter- pretation of S.

  • Form of the states in Σ (and actions in A):

structure of S

  • Computation paths π of S:

behaviour of S (Harel, 1997) proposes to distinguish constructive and reflective descriptions of behaviour:

  • constructive:

“constructs [of description] contain information needed in executing the model or in translating it into executable code.” → how things are computed.

  • reflective (or assertive):

“[description used] to derive and present views of the model, statically or during execution,

  • r to set constraints on behavior in preparation for verification.”

→ what should (or should not) be computed. Note: No sharp boundaries! (would be too easy...)

slide-13
SLIDE 13

Topic Area Architecture & Design: Content

– 11 – 2018-06-14 – Sblockcontent –

23/55

  • Introduction and Vocabulary
  • Software Modelling
  • model; views / viewpoints; 4+1 view
  • Modelling structure
  • (simplified) class & object diagrams
  • (simplified) object constraint logic (OCL)
  • Principles of Design
  • modularity, separation of concerns
  • information hiding and data encapsulation
  • abstract data types, object orientation
  • Design Patterns
  • Modelling behaviour
  • communicating finite automata (CFA)
  • Uppaal query language
  • CFA vs. Software
  • Unified Modelling Language (UML)
  • basic state-machines
  • an outlook on hierarchical state-machines
  • Model-driven/-based Software Engineering

VL 11 . . . VL 12 . . . VL 13 . . . VL 14 . . .

– 11 – 2018-06-14 – main –

24/55

slide-14
SLIDE 14

Class Diagrams

– 11 – 2018-06-14 – main –

25/55

slide-15
SLIDE 15

Concrete Syntax: Example

– 11 – 2018-06-14 – Sumlsig –

27/55 C

n : C∗ p : C0,1

D

x : Int p : C0,1 f(Int) : Bool get_x() : Int x : Int p : C0,1

Alternative notation for C0,1 and C∗ typed attributes:

C D

x : Int f(Int) : Bool get_x() : Int

  • p

0..1 ×

  • p

0..1 ×

  • n

0..∗ ×

Alternative lazy notation for alternative notation:

C D

x : Int f(Int) : Bool get_x() : Int p 0..1 p 0..1 n 0..∗

And nothing else! This is the concrete syntax of class diagrams for the scope of the course.

Abstract Syntax: Object System Signature

– 11 – 2018-06-14 – Sumlsig –

28/55

  • Definition. An (Object System) Signature is a 6-tuple

S = (T, C, V, atr , F, mth) where

  • T is a set of (basic) types,
  • C is a finite set of classes,
  • V is a finite set of typed attributes v : T, i.e., each v ∈ V has type T,
  • atr : C → 2V maps each class to its set of attributes.
  • F is a finite set of typed behavioural features f : T1, . . . , Tn → T,
  • mth : C → 2F maps each class to its set of behavioural features.
  • A type can be a basic type τ ∈ T , or C0,1, or C∗, where C ∈ C .

Note: Inspired by OCL 2.0 standard OMG (2006), Annex A.

slide-16
SLIDE 16

Object System Signature Example

– 11 – 2018-06-14 – Sumlsig –

29/55

  • Definition. An (Object System) Signature is a 6-tuple

S = (T, C, V, atr , F, mth) where

  • T is a set of (basic) types,
  • C is a finite set of classes,
  • V is a finite set of typed attributes v : T, i.e., each v ∈ V has type T,
  • atr : C → 2V maps each class to its set of attributes.
  • F is a finite set of typed behavioural features f : T1, . . . , Tn → T,
  • mth : C → 2F maps each class to its set of behavioural features.
  • A type can be a basic type τ ∈ T , or C0,1, or C∗, where C ∈ C .

S0 = ({Int, Bool}, {C, D}, {x : Int, p : C0,1, n : C∗}, {C → {p, n}, D → {p, x}}, {f : Int → Bool, get_x : Int}, {C → ∅, D → {f, get_x}})

From Abstract to Concrete Syntax

– 11 – 2018-06-14 – Sumlsig –

30/55 C D

x : Int f(Int) : Bool get_x() : Int

p 0..1 p 0..1 n 0..∗

S = (T, C, V, atr , F, mth)

  • T ={Int, Bool}
  • C ={C, D}
  • V ={x : Int, p : C0,1, n : C∗}
  • atr ={C → {p, n}, D → {p, x}}
  • F ={f : Int → Bool, get_x : Int}
  • mth ={C → ∅, D → {f, get_x}}
slide-17
SLIDE 17

Once Again: Concrete vs. Abstract Syntax

– 11 – 2018-06-14 – Sumlsig –

31/55

S0 = ({Int, Bool}, {C, D}, {x : Int, p : C0,1, n : C∗}, {C → {p, n}, D → {p, x}}, {f : Int → Bool, get_x : Int}, {C → ∅, D → {f, get_x}})

C n : C∗ p : C0,1 D x : Int p : C0,1 f(Int) : Bool get_x() : Int x : Int p : C0,1 C D x : Int f(Int) : Bool get_x() : Int

  • p

0..1 ×

  • p

0..1 ×

  • n

0..∗ × C D x : Int f(Int) : Bool get_x() : Int p 0..1 p 0..1 n 0..∗ D x : Int f(Int) : Bool get_x() : Int C p 0..1 p 0..1 n 0..∗ C n : C∗ p : C0,1 D x : Int p : C0,1 f(Int) : Bool get_x() : Int x : Int p : C0,1 C D x : Int f(Int) : Bool get_x() : Int p 0..1 p 0..1 n 0..∗

Class Diagrams at Work

– 11 – 2018-06-14 – main –

32/55

slide-18
SLIDE 18

Visualisation of Implementation

– 11 – 2018-06-14 – Scdatwork –

33/55

  • The class diagram syntax can be used to visualise code:

Provide rules which map (parts of) the code to class diagram elements.

1

package pac ;

2 3

import pac .D;

4 5

public c lass C {

6 7

public D n ;

8 9

public void print_nx ( ) {

10

System . out . p r i n t f (

11

"%i \n" , n . get_x ( ) ) ; } ;

12 13

public C ( ) { } ;

14

}

1

package pac ;

2 3

import pac . C ;

4 5

public c lass D {

6 7

private int x ;

8 9

public int get_x ( )

10

{ return x ; } ;

11 12

public D ( ) { } ;

13

}

Visualisation of Implementation

– 11 – 2018-06-14 – Scdatwork –

33/55

  • The class diagram syntax can be used to visualise code:

Provide rules which map (parts of) the code to class diagram elements.

1

package pac ;

2 3

import pac .D;

4 5

public c lass C {

6 7

public D n ;

8 9

public void print_nx ( ) {

10

System . out . p r i n t f (

11

"%i \n" , n . get_x ( ) ) ; } ;

12 13

public C ( ) { } ;

14

}

1

package pac ;

2 3

import pac . C ;

4 5

public c lass D {

6 7

private int x ;

8 9

public int get_x ( )

10

{ return x ; } ;

11 12

public D ( ) { } ;

13

}

pac

C

print_nx(); C();

D

x : int get_x() : int; D(); n 0..1

slide-19
SLIDE 19

Visualisation of Implementation: (Useless) Example

– 11 – 2018-06-14 – Scdatwork –

34/55

  • open favourite IDE,
  • open favourite project,
  • press “generate class diagram”
  • wait...wait...wait...
  • x
x
  • xx
xx
  • !
"#$! xx xx % #&! '(&! ")&! xx xx
  • xx
xx
  • xx
xx % *+,-! xx xx
  • xx
xx
  • "(+!
",(./// "+,! xx xx %
  • +,(.+,///
'(&! '(&! '(&! '(&! '(&(! "(+,! x x
  • xx
xx
  • "0-0
xx xx % *.& ,! *.&+,! *.&+,!
  • #&0-01
! "+,-#&! xx xx
  • xx
xx
  • xx
xx % '0& +,! xx xx
  • xx
xx
  • xx
xx % +2&, )*#! )&3 45(&6 ! x x
  • xx
xx
  • xx
xx % +2&, (! 45(&6 ! (&3 xx xx
  • xx
xx
  • )!
! ") " ! "7-/// xx xx %
  • &7!
#&0-0! xx xx
  • xx
xx
  • "-!
xx xx %
  • ,+!
8& -! "+-,&! xx xx
  • xx
xx
  • ///
"9(7! xx xx %
  • 4+, ///
'(&! 9(7+,! ")%'&/// xx xx
  • xx
xx
  • "///
"9(7! "0-0 xx xx % /// 9(7/// x x
  • xx
xx
  • )')!
"7' /// "* /// "0-0 "'$! xx xx % $&#/// # #/// 7/// 7/// 7&3 :&3 %-(&3$ /// x x
  • xx
xx
  • 5 5
  • "
; /// xx xx % $&3 &)< !
  • &///
  • ///
  • "$&///
"$ #&+,1 ! "$ #&+,1 ! " $*& ! " $-& !
  • "7///
  • "(0'///
  • "///
  • "///
  • "*///
  • "((///
" 7($! " +-! " #:<'!
  • "4 %+///
"&-=>?! " <)7! " $0@9! " $0! xx xx
  • xx
xx
  • )')!
7*7*! 7* /// "7 (! "' ;/// ".$ "0-0 xx xx % $'/// # #/// 7/// 7///
  • 4#)///
/// '(&! '(&! '(&! '(&#! '(&! " 7('! " #-! " -! " -!
  • " :) ///
" -(&(! " 08! " 0<'8! " 07(! " 07(7<! xx xx
  • xx
xx
  • xx
xx % *-&3 &0/// 0+,! xx xx
  • xx
xx
  • "
/// "' 5(/// xx xx % *-&/// '(&! xx xx
  • xx
xx
  • ",+,///
"($! xx xx %
  • +,///
'(&! "+,:&3 xx xx
  • xx
xx
  • +,///
",$! " +, ! 0-0
  • '-!
xx xx % +,'! '%! %&(! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&(! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&2! '(&,! '(&! '(&! '(&#! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&(! '(&! '(&! '(&'! " %<! " $8%#! " +'&! "(-/// " <&+,! " %#&! " 7&! " 7*#! " *':! "*'/// " ! " ! " 5'! " -#! " '*! " '$.*! " '$.%*! " ''*(! " '+,'%! " '#-(#*! " '*! " '! " '*(-(#*! " '-! " 8&! /// A &! x x
  • xx
xx
  • "588!
" 7,-! "*) "0-0 "9) xx xx % +'8! )8&! 45&3 05&0-! *5&+,1 ! 95&0 ! xx xx
  • xx
xx
  • $)!
)! 88! 8! ()! )) $.) $.+,'% ! $.<)! $.%) $B) $8! $,)$7! $,) 7! $,)*7! $,)7! #58 ! #*! 6-)! +,8 ! ) )! B*) B) 8! #-(#) <*# *B ) *B) *') *4()! *4(%! *()! *(%+2! *) *)! *7) *) * *8! *#(! *#*! *#! *# *#! *(-(#)
  • )
)!
  • !
,B$)! ,B ) ,B*)! ,B)! B$) B ) B*)
  • !
,- )! *! xx xx % )! 8/// &+,! )&0 ! 5&3 &0 0! x x
  • xx
xx
  • xx
xx % 5)&3 xx xx
  • xx
xx
  • 7
! 7 ! 7! xx xx % (7&!
  • &3-
x x
  • xx
xx
  • "- !
"<-/// xx xx % <-! <-! '(&! '(&! xx xx
  • xx
xx
  • "
" xx xx % *&(! *.(&! x x
  • xx
xx
  • ;-///
!
  • $!
##! ,)- 5$ (* ! $( ! ( ;-/// +, ! 5$! (-! ()0! (<'!
  • ;-
C .(7$! xx xx % %&3 x x
  • xx
xx
  • xx
xx % +&.0,! 7&3 x x
  • xx
xx
  • "'$!
A*,! A' ! xx xx % +2&, *#! 45(& ! " *,+2'! xx xx
  • xx
xx
  • A-
A- A2$ xx xx % A 77&! A *)&! A *)&! xx xx !
  • xx
xx
  • (<!
  • ///
/// /// /// /// 55 7/// 8! ! +,8! 8 /// ((.+,/// ()/// %% *#<! *8)!
  • ))
! (8) 7 ! 7/// () /// 2<! "< )/// "<)/// " $! "+' /// ") /// "( /// "7/// "*/// "-/// "-/// "-#/// "-+2/// "/// ")/// "7/// "( /// "4+/// ", /// "8 /// "(5 " "8 /// " ($! " <-! "% "6)/// "(8) "7 /// "7)/// " 2<- ! ".($ A( .! A-0
  • ///
xx xx % & ! &! ++&! $&! $(&(! $(&! $&! 4! )(&! )(& ! & ! &! *'&! +&! ++&/// )%(! )%! )%! )%! )%! )%! )%! )%+'8! )%)8! )%)! )%4! )%8! )%< ! )%<! )%7! )%7! )%7! )%7! )%7! )%*! )%*! )%#&! )%#7! )78! 4!
  • 4///
($! 4<7! 44! <-! *(&(! **'&(! *7!
  • 0&( ///
& ! :&(! " 7&! " 7<.&! " -&! " )%#! "47&#/// " 7&( ! " -(&(! A #!
> 5
> %!
  • xx
xx
  • xx
xx
  • " 7,-!
"0-0 xx xx % +'8! )8&! 05&0-! *5&+,1 !
  • )5&3
95&0 ! x x
  • xx
xx
  • #')!
  • !
7*7*!
  • $-!
"-$ " - ! ",$! "0-0 xx xx % 4(! *+,& ! *+,&3
  • '!
(&/// '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&,! '(&#! '(&#! '(&! '(&! '(&! '(&! '(&! '(&! '(&! '(&(! '(&.! " +,)&,! " *+,5! x x
  • xx
xx
  • xx
xx % +,! +,! xx xx
  • xx
xx
  • A (
! A #! A8 ! xx xx %
  • $&///
$&( ! $-& ! $-& ! $-& !
  • 4///
2(! 4(! 4)! 48<!
  • & !
0&69(!
  • 8!
  • "4///
" 4*%#-! x x
  • xx
xx
  • 7
xx xx % &0/// 0+,! 0'/// 0-'! ')&3 xx xx
  • xx
xx
  • "@
/// " ! A ! A ! xx xx % *.&*! *.&*#! *.*#! xx xx "
  • xx
xx
  • ///
xx xx % &0/// 0+,! 0'/// 9(7&3
  • ca. 35 classes,
  • ca. 5,000 LOC C#

Visualisation of Implementation: (Useful) Example

– 11 – 2018-06-14 – Scdatwork –

35/55

Tron Joystick? ... Keyboard? Control Player

colour score direction speed

Gameplay Render OpenGL? ... aalib? AI? Segment

x0, y0 x1, y1 colour

Engine

areawidth areaheight

1..∗ notify update 0..∗ head world 1..∗

  • A diagram is a good diagram if (and only if?) it serves its purpose!
  • Note: a class diagram for visualisation may be partial.

→ show only the most relevant classes and attributes (for the given purpose).

  • Note: a signature can be defined by a set of class diagrams.

→ use multiple class diagrams with a manageable number of classes for different purposes.

slide-20
SLIDE 20

Literature Recommendation

– 11 – 2018-06-14 – Scdatwork –

36/55

(Ambler, 2005)

Tell Them What You’ve Told Them. . .

– 11 – 2018-06-14 – Sttwytt –

53/55

  • Design structures a system into manageable units.
  • (Software) Model: a concrete or mental image or archetype with
  • image / reduction / pragmatics property.
  • Towards Software Modelling:
  • Views and Viewpoints, e.g. 4+1,
  • Structure vs. Behaviour
  • Class Diagrams can be used

to describe system structures graphically

  • visualise code,
  • define an object system structure S .
  • An Object System Structure S

(together with a structure D)

  • defines a set of system states ΣD

S ;

  • a system state is structured according to S .
  • A System State σ ∈ ΣD

S

  • can be visualised by an object diagram.
slide-21
SLIDE 21

References

– 11 – 2018-06-14 – main –

54/55

References

– 11 – 2018-06-14 – main –

55/55

Ambler, S. W. (2005). The Elements of UML 2.0 Style. Cambridge University Press. Bachmann, F., Bass, L., Clements, P., Garlan, D., Ivers, J., Little, R., Nord, R., and Stafford, J. (2002). Documenting software architecture: Documenting interfaces. Technical Report 2002-TN-015, CMU/SEI. Bass, L., Clements, P., and Kazman, R. (2003). Software Architecture in Practice. The SEI Series in Software Engineering. Addison-Wesley, 2nd edition. Broaddus, A. (2010). A tale of two eco-suburbs in Freiburg, Germany: Parking provision and car use. Transportation Research Record, 2187:114–122. Ellis, W. J., II, R. F. H., Saunders, T. F., Poon, P. T., Rayford, D., Sherlund, B., and Wade, R. L. (1996). Toward a recommended practice for architectural description. In ICECCS, pages 408–413. IEEE Computer Society. Glinz, M. (2008). Modellierung in der Lehre an Hochschulen: Thesen und Erfahrungen. Informatik Spektrum, 31(5):425–434. Harel, D. (1997). Some thoughts on statecharts, 13 years later. In Grumberg, O., editor, CAV, volume 1254 of LNCS, pages 226–231. Springer-Verlag. IEEE (1990). IEEE Standard Glossary of Software Engineering Terminology. Std 610.12-1990. IEEE (2000). Recommended Practice for Architectural Description of Software-Intensive Systems. Std 1471. Kruchten, P. (1995). The “4+1” view model of software architecture. IEEE Software, 12(6):42–50. Ludewig, J. and Lichter, H. (2013). Software Engineering. dpunkt.verlag, 3. edition. OMG (2006). Object Constraint Language, version 2.0. Technical Report formal/06-05-01. Schumann, M., Steinke, J., Deck, A., and Westphal, B. (2008). Traceviewer technical documentation, version 1.0. Technical report, Carl von Ossietzky Universität Oldenburg und OFFIS. Taylor, R. N., Medvidovic, N., and Dahofy, E. M. (2010). Software Architecture Foundations, Theory, and Practice. John Wiley and Sons.