0% found this document useful (0 votes)
60 views14 pages

5.2-System Modeling Part2

Behavioral models show how a system responds and changes states in response to external stimuli like data or events. Data-driven models focus on how a system processes input data and produces outputs, while event-driven models show how a system responds to external and internal events. State machine models represent systems as a series of states that are transitioned between in response to events.

Uploaded by

Moiz Adnan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views14 pages

5.2-System Modeling Part2

Behavioral models show how a system responds and changes states in response to external stimuli like data or events. Data-driven models focus on how a system processes input data and produces outputs, while event-driven models show how a system responds to external and internal events. State machine models represent systems as a series of states that are transitioned between in response to events.

Uploaded by

Moiz Adnan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Behavioral models

 Behavioral models are models of the dynamic


behavior of a system as it is executing. They show
what happens or what is supposed to happen when a
system responds to a stimulus from its environment.
 You can think of these stimuli as being of two types:
 Data Some data arrives that has to be processed
by the system.
 Events Some event happens that triggers system
processing. Events may have associated data,
although this is not always the case.
Data-driven modeling
 Many business systems are data-processing
systems that are primarily driven by data. They are
controlled by the data input to the system, with
relatively little external event processing.
 Data driven models show the entire sequence of
actions that take place from an input being
processed to the corresponding output, which is the
system’s response.
 They are particularly useful during the analysis of
requirements as they can be used to show end-to-
end processing in a system.
Data Flow Diagram of equipment procurement process
Data Flow Diagram of place equipment order
Event-driven modeling
 Real-time systems are often event-driven, with
minimal data processing. For example, a landline
phone switching system responds to events such as
‘receiver off hook’ by generating a dial tone.
 Event-driven modeling shows how a system
responds to external and internal events.
 It is based on the assumption that a system has a
finite number of states and that events (stimuli) may
cause a transition from one state to another.
State machine models
 They model the behaviour of the system in response
to external and internal events.
 They show the system’s responses to stimuli, so are
often used for modelling real-time systems.
 State machine models show system states as
nodes and events as arcs between these nodes.
 When an event occurs, the system moves from one state to
another.
 State diagrams are an integral part of the UML and
are used to represent state machine models.
State diagram of a microwave oven
System
state
Event Action taken
Stimuli for the microwave oven

Stimulus Description
Half power The user has pressed the half-power button.

Full power The user has pressed the full-power button.


Timer The user has pressed one of the timer buttons.

Number The user has pressed a numeric key.


Door open The oven door switch is not closed.
Door closed The oven door switch is closed.
Start The user has pressed the Start button.
Cancel The user has pressed the Cancel button.
States for the microwave oven
State Description
Waiting The oven is waiting for input. The display shows the current time.
Half power The oven power is set to 300 watts. The display shows ‘Half power’.
Full power The oven power is set to 600 watts. The display shows ‘Full power’.
Set time The cooking time is set to the user’s input value. The display shows
the cooking time selected and is updated as the time is set.
Disabled Oven operation is disabled for safety. Interior oven light is on.
Display shows ‘Not ready’.
Enabled Oven operation is enabled. Interior oven light is off. Display shows
‘Ready to cook’.
Operation Oven in operation. Interior oven light is on. Display shows the timer
countdown. On completion of cooking, the buzzer is sounded for five
seconds. Oven light is on. Display shows ‘Cooking complete’ while
buzzer is sounding.
Activity diagram of involuntary
patient detention
Model-driven engineering
 Model-driven engineering (MDE) is an approach to
software development where models rather than
programs, are the principal outputs of the
development process.
 The programs that execute on a hardware/software
platform are then generated automatically from the
models.
 Advocates of MDE argue that this raises the level of
abstraction in software engineering so that engineers
no longer have to be concerned with programming
language details or the specifics of execution
platforms.
Multiple platform-specific
models
Usage of model-driven
engineering
 Model-driven engineering is still at an early stage of
development, and it is unclear whether or not it will have a
significant effect on software engineering practice.
 Advantages
 Allows systems to be considered at higher levels of
abstraction
 By using powerful tools, system implementations can be
generated for different platforms from the same model.
 Therefore, to adapt the system to some new platform
technology, it is only necessary to write a translator for that
platform.
 Generating code automatically means that it is cheaper to
adapt systems to new platforms.
Usage of model-driven
engineering
 Disadvantages
 models are a good way of facilitating discussions
about a software design.
 However, it does not always follow that the
abstractions that are supported by the model are
the right abstractions for implementation.
 Savings from generating code may be outweighed
by the costs of developing translators for new
platforms.

You might also like