1. Trang chủ
  2. » Công Nghệ Thông Tin

Chương 13: Modeling System Behaviours doc

22 248 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 22
Dung lượng 1,27 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Scenario as UML sequence diagrams 2Figure 13.2 – Sequence diagram for a loan scenario : LoanManager BookRequest PatrID, BookID : Staff self-interaction event attributes instance disa

Trang 1

Building System Models for RE

Chapter 13 Modeling System Behaviours

Trang 2

Building models for RE

Behaviors

Trang 3

The behaviour model

Specific behaviours of specific agent instances All possible behaviours of any agent instance.

Trang 4

Modeling system behaviours: outline

Trang 5

Modeling instance behaviours

– Positive scenario: the sequence of interactions illustrates a possible Positive scenario: way of satisfying an behavioural goal.

– Negative scenario: the sequence of interactions illustrates a possible Negative scenario: way of satisfying an obstacle to a goal.

 Interaction: Interaction

operation whose effect is monitored by the target agent

instance.

Trang 6

Scenario as UML sequence diagrams

 Sequence diagrams are a UML variant of the event trace diag.

 Basic UML syntax for sequence diagrams is similar to the one used in event trace diagrams.

Figure 13.1 – Scenario represented by a sequence diagram

: Train Actuator/Sensor

: OnBoard Controller

doorsOpening

exit doorsClosing

event name

! trainStopped

startAcceler

Trang 7

Scenario as UML sequence diagrams (2)

Figure 13.2 – Sequence diagram for a loan scenario

: LoanManager BookRequest (PatrID, BookID)

: Staff

self-interaction event attributes

instance disappears

: CopyManager

LoanQtyOK? (PatrID) CpyAvailable? (BookID)

Reserved? (BookID) OK-Available (CopyID)

OK-Book (PatrID, CopyID) checkOut (PatrID, CopyID)

Registered? (PatrID)

Figure 13.3 – Negative scenarios and optional interactions

opt

: Train Actuator/Sensor

: OnBoard

Controller

AlarmPressing AccelerComnd

doorsOpening

exit doorsClosing

:Passenger

optional interaction

: Passenger

: OnBoard Controller

! trainStopped

startAcceler AlarmPropagation

Trang 8

Scenario refinement: Episodes and agent

decomposition

coarse-grained scenario first then refine it with further details

Trang 9

Scenario refinement: Episodes

Figure 13.4 – Scenario refinement: introducing episodes

:Scheduler meetingRequest

(dateRange, withWhom)

: Initiator

reference to another diagram

: Participant

schedule DeterminationConstraintsAcquired

notification (date, location)

notification (date, location)

:Scheduler

? constraints (dateRange)

Trang 10

Scenario refinement: agent decomposition

Figure 13.5 – Scenario refinement: agent decomposition

: LoanManager : Staff : CopyManager

CpyAvailable? (BookID)

Reserved? (BookID)

OK-Available (CopyID)checkOut (PatrID,CopyID)

BookRequest (PatrID, BookID)

OK-Book (PatrIDCopyID)

LoanQtyOK? (PatrID)Registered? (PatrID)

Trang 11

Modeling system behaviours: outline

Trang 12

Modeling class behaviours

provided by scenarios in multiple ways:

specific one.

state transitions, not just a specific one

 Snapshot state <-> SM state

 State transitions captured by a state machine refer to SM states.

 The events causing state transitions can be of different types:

does not controls.

the State Machine

Trang 13

State machines as UML state diagrams

 A state machine is represented in UML by a variant of a statechart called a state diagram.

 Some features …

Figure 13.6 – A simple SM diagram for a BookCopyInfo entity controlled by LibraryManager

checkOut (PatrID, self)

return (PatrID, self)

event with attribute

loss

SM state

initial state final state

transition

Trang 14

State machines as UML state diagrams (2)

‘producing’ diagram to a ‘consuming’ diagram where this event causes transitions.

Trang 15

State machines as UML state diagrams (3)

Figure 13.7 – A SM diagram for a BookInfo entity controlled by LibraryManager

Trang 16

State machines as UML state diagrams (4)

Figure 13.9 – Send actions for diagram synchronization: BookCopyInfo revisited

Available onLoan

event notification

to consumer

loss

/ send BookInfo.copyReturn / send BookInfo.copyBorrowing

OK-request

/ Inform initiator

ConstraintsRequested entry / Inform initiator Planning

Trang 17

State machine refinement: sequential and concurrent

sub-states

– Sub-state -> nested state / super-state -> composite state

of nested diagrams.

Trang 18

State machine refinement: sequential decomposition

 Semantic rules define sequential state decomposition more precisely: [textbook, p459)

Trang 19

State machine refinement: parallel decomposition

 Semantic rules define parallel state decomposition more precisely:

state name composite state

concurrent

substate

guard as synchronizing condition + sequential

decomposition

Trang 20

Modeling system behaviours: outline

Trang 21

Building behaviour models

strengths and limitations:

– Goals are declarative, capture functional, non-functional and alternative options aspects.

of expression.

– State machines provide visual abstractions of explicit

behaviours of any agent instance in a class.

partnership for building complex models.

scenarios and state machines (textbook.p464).

Trang 22

Building behaviour models

Ngày đăng: 13/07/2014, 07:20

TỪ KHÓA LIÊN QUAN