• Ingen resultater fundet

Advanced Topics in Software Engineering

N/A
N/A
Info
Hent
Protected

Academic year: 2022

Del "Advanced Topics in Software Engineering"

Copied!
51
0
0

Indlæser.... (se fuldtekst nu)

Hele teksten

(1)

Advanced Topics in

Software Engineering

(02265)

Ekkart Kindler

(2)

Ekkart Kindler

VI. Modelling Behaviour

(3)

Ekkart Kindler

1. Behaviour in UML

In UML, there are different concepts and diagrams that concern behaviour modelling

 Use case diagrams

 Activity diagrams

 Interaction diagrams

Sequence diagrams

Communication diagrams

 State machine diagrams (State Charts)

 Methods of classes (MOF: Operation)

(in combination with OCL, the input/output relation of a method can be specified)

(4)

Ekkart Kindler

Activity diagrams

From: OMG Unified Modeling Language (OMG UML), Superstructure, V2.1.2, November 2007, p. 331

(5)

Ekkart Kindler

turn key

“Sequence Diagram”

rain sensor ignition

switch

wiper wiper

control

on

rain

on off

(6)

Ekkart Kindler

”Communication Diagram”

ignition switch

rain sensor

wiper wiper

control

1: on

2: off

3: rain

4: on

(7)

Ekkart Kindler

Sequence diagram (details)

o:Order item 1 product 1 item 2 product 2 :Customer

getPrice()

getPrice()

getPrice()

amount() sum1

getPrice()

getPrice()

amount() sum2

getCustomerDiscount() discount

Lifeline

Message

Events Events

total

(8)

Ekkart Kindler

Sequence diagram (details)

o:Order item 1 product 1 item 2 product 2 :Customer

getPrice()

getPrice()

getPrice()

amount() sum1

getPrice()

getPrice()

amount() sum2

getCustomerDiscount() discount

Call (synchronous)

return

Self- call

total Activation

(9)

Ekkart Kindler

“State machines”

wiper control

engine off

wiper off

rd.rain/w.on rd.dry/w.off

i

rd

w Message

wiper on

on

Initial state

off

rain on

off

(10)

Ekkart Kindler

Use of state machines

ignition switch

rain sensor

wiper wiper

control

wiper

One automaton for each component (plus structure) defines the complete behaviour of our “wiper system”.

(11)

Ekkart Kindler

“State machines”

wiper control

engine off

wiper off i.on/w.off

i.off/w.off

rd.rain/w.on

rd.dry/w.off

i

rd

w

wiper on

Complex state

(12)

Ekkart Kindler

Behaviour in UML

 Use case diagrams

 Activity diagrams

 Interaction diagrams

Sequence diagrams

Communication diagrams

 State machine diagrams (State Charts)

 Methods of classes

(in combination with OCL, the input/output relation of a method can be specified)

(13)

Ekkart Kindler

2. Other behaviour models

Just to give a rough idea of the many concepts and notations out there

 Kripkestructures / Transition systems

 Petri nets

 Story Pattern (”Programming in Pictures”)

 Process algebras (synchronisation of events)

 Event-driven Process Chains (EPCs), BPMN, ...

 BPEL, WSDL

(14)

Ekkart Kindler

Example: Material Flow System

Robot

Track Shuttle

Simple Gate

Good

at occupied

1 0..1 0..1 0..1

pred succ

(15)

Ekkart Kindler

An Instance

t1:Simple s:Shuttle

pred

occ

t2:Simple succ

at :Simple

pred succ

pred

:Simple succ

(16)

Ekkart Kindler

Behaviour

t1:Simple s:Shuttle

pred

occ

t2:Simple succ

at

at

occ :Simple

pred succ

pred

:Simple succ

before

after

(17)

Ekkart Kindler

Story Pattern

t1:Simple s:Shuttle

pred

occ

t2:Simple succ

at

at

occ

<<delete>>

s:Shuttle occ

at

(18)

Ekkart Kindler

Reimb.

data avail.

EPC: Business Trip

trip is planned

determine trip data

data de- termined

fill in form

form

submitted form received

form

submitted form received

make trip evaluate form trip was

made

send receipts

reimburse expenses

expenses

(19)

Ekkart Kindler

Event:

Indicates the entry into a specific state

Function:

An action

Flow of control:

between functions and events (only)

Connectors:

define split and join of the flow of control

EPC Constructs

(20)

Ekkart Kindler

Synchronisation of events

comp 1

comp 2

b a b

These two events (actions) can only be executed

together (atomic

synchronous execution) c

d

These two events (actions) can only be executed

together (atomic

synchronous execution)

(21)

Ekkart Kindler

Synchronisation of events

 The concept of event synchronisation is featured by process algebras (in different flavours)

 Event synchronisation makes events of different automata happen atomically

 This allows to coordinate behaviour of different parts of a system on a higher level of abstraction

(22)

Ekkart Kindler

3. Business Processes

 Businesses processes are at the core of a business

 Business processes are one of the main assets of an enterprise

 Information systems and in particular ERP systems must support these processes

 Therefore, business processes are essential for developping (or customizing) IT support for such enterprises

(23)

Ekkart Kindler

Example: Business trip

determine trip data

apply for trip

support trip

book trip

approve

trip send

trip form

make

trip fill in trip form

reimburse expenses

(24)

Ekkart Kindler

Business process

A business process consists of a collection of activities that are executed in some enterprise or administration according to certain rules and with respect to certain goals.

A workflow is the realization/implementation of a business process by some information system.

(25)

Ekkart Kindler

Examples

 Business trip

 Hospital information system

Patient registration

Special physical examination of a patient

Complete stay of a patient

 Facility management

apply for the construction of a new building

 Production

Air plane construction

 ...

(26)

Ekkart Kindler

Observations

1. Business processes can take quite different time:

from a few seconds to several months or even years.

Slogan from transaction theory:

„Workflows are long-lived transactions“

(27)

Ekkart Kindler

Observations

2. A business process can be composed from other business processes.

Slogan from transaction theory:

„Workflows are nested transactions“

(28)

Ekkart Kindler

Observations

3. The order of activities is fully defined in some examples; in other examples, there is only a vaguely defined order.

In some examples, the order is not defined at all;

maybe, not even the possible activities are defined.

(29)

Ekkart Kindler

Our example revisited

determine trip data

apply for trip

support trip

book trip

approve

trip send

trip form

make

trip fill in trip form

reimburse expenses

(30)

Ekkart Kindler

Activity / Task

An task of a business process is an atomic work step that, on the given level of abstraction, cannot be split into more detailed steps.

NB: „Atomic“ is with respect to some given or chosen level of abstraction.

(31)

Ekkart Kindler

Task

Examples:

fill in an application form

support trip (signature of superior)

send a reminder

take a blood-sample

pay out a credit

(32)

Ekkart Kindler

Observations

4. The level of automation of a task varies:

Some tasks/activities can be executed fully automatically.

Some tasks/activities can be executed semi- automatically.

Some tasks/activities can be executed manually only.

(33)

Ekkart Kindler

Business Trip: Documents

note

note

trip documents receipts

application form

reimburse- ment form

reimburse- ment form

& receipts copy of af

determine trip data

apply for trip

support trip

book trip

approve

trip send

trip form

make

trip fill in trip form

reimburse expenses

(34)

Ekkart Kindler

Document

In a business process, documents are created, used, and changed.

These documents help to exchange information among different activities of the same business

process and among different business processes.

(35)

Ekkart Kindler

Document

Examples:

Applications

Approvals

Contracts

Reminders

Receipts

Tickets, ...

Notes

(36)

Ekkart Kindler

Remarks

 Documents can be in electronic form or on paper.

 We use documents as a modelling concept; we abstract from its physical presentation.

In work flow management systems, documents will be maintained in a database (etc.)

(37)

Ekkart Kindler

Tasks and Documents

The documents needed by the task

The documents produced by the task

(38)

Ekkart Kindler

Business Trip: Agents

determine trip data

apply for trip

support trip

book trip

approve

trip send

trip form

make

trip fill in trip form E. Kindler

E. Kindler

E. Kindler E. Kindler M. Bau-

meister F. Stassen C. Nexø

NN

E. Kindler

reimburse expenses

(39)

Ekkart Kindler

Resources and Agents

A resource is a means necessary for executing an activity.

When the resource is a person, we call the resource an agent.

(40)

Ekkart Kindler

Resources and Agents

Examples:

Persons (E. Kindler, F. Stassen, ...)

Printers

Computers

Devices (e.g. for analysing blood)

...

(41)

Ekkart Kindler

Remarks

 In a concrete instance of a business process, there are concrete resources and agents –keeping track of the involved resources is good for documentation purposes.

 In a model of a business process, concrete

resources and concrete agents are problematic (business trip, vacations, sick leave, etc.)

(42)

Ekkart Kindler

Roles

A role is the capability (or competence) of an agent or a resource to execute specific activities.

The same resource can have several roles.

Roles can be considered as a classification of resources.

(43)

Ekkart Kindler

Roles

Examples:

research assistant

superior

director

doctor

clerk

head of department

...

(44)

Ekkart Kindler

Re: Business Trip

determine trip data

apply for trip

support trip

book trip

approve

trip send

trip form

make

trip fill in trip form lecturer

lecturer

lecturer lecturer

superior dean secretary

clerk

lecturer

reimburse expenses

(45)

Ekkart Kindler

Triggers

Activities can be triggered in different ways:

 automatically

 by an agent

 by an external event

 by time(out)

(46)

Ekkart Kindler

Example: Complaint processing

register send form process

complaint archive

Problem:

What if the customer never returns the form?

(47)

Ekkart Kindler

Example: Complaint processing

register send form process

complaint archive

Solution:

Externally triggered activities are equipped with an non-external alternative!

abort processing Exception:

The start activity does not need an alternative!

(48)

Ekkart Kindler

Aspects of Business Processes

Control Organisation

Information

Integration

(49)

Ekkart Kindler

4. Discussion

 There are notations for, virtually, any kind of behaviour!

 Actually, hundreds of them!

 So, why is there a problem with modelling behaviour?

(50)

Ekkart Kindler

Problems

The problem is not modelling behaviour, but modelling it in such a way that these models:

 can be (easily) integrated with the structural models

 with other behavioural models of the same kind

 with other behavioural models of different kind

 with existing code

 other systems

and such that they can be automatically executed or code can be generated from them.

(51)

Ekkart Kindler

Reasons

Fine grain vs. coarse grain behaviour Intra-object vs. inter-object behaviour Reactive vs. transformational behaviour Coordination of vs. computation

Synchronisation vs. invocation Events vs. methods

Processes vs. classes

Concurrency vs. threading

Referencer

RELATEREDE DOKUMENTER

Travel Agency functional requirements: Detailed use case diagram plan trip..

Domain Engineering: Technology Management, Research and Engineer- ing [9], chapter 1: On Domains and On Domain Engineering – Prerequisites for Trust- worthy Software – A Necessity

Due to the difficulty involved in the design and development of complex software systems, wide ranges of software engineering paradigms have been developed, such as

 In some situtations (when using GMF), you can use Recording commands – basically programming as usual except for the set up (tutorial 2).  When changes are made in a GMF

Process models are the distilled experience of project plans of successful software projects. they are idealized and abstract from (many) details this is their strength (and

 Like EMOF, CMOF can be defined in terms of its own concepts (or in terms of EMOF)..

 Concepts and underlying theory of Model-based Software Engineering (with focus on the meta-level).  Relation between the concepts and rationale

Satisfiability is reduced to emptiness of regular languages Decidable result for both discrete and continuous time Seemingly small extensions give undecidable subsets.. RDC