06 SWEng_System Modeling Part II
06 SWEng_System Modeling Part II
Modelling &
Design
Software Engineering
State diagrams show system states and events that cause transitions
from one state to another. They do not show the flow of data within
the system but may include additional information on the
computations carried out in each state.
The labeled arrows represent stimuli that force a transition from one
state to another.
The diagram uses start and end states using filled circles, as in activity
diagrams.
Software Engineering - H.A.
6
These diagrams are a good way to model the dynamic behavior of a class
State chart diagrams aren't created for every class. Only if an object of the
class can exist in several states, and behaves very differently in each of the states
State chart diagrams are created for documentation only, no source code is
generated from it
Software Engineering - H.A.
State Chart Diagram
11
For example, a bank account can exist in several different states. It can be open, closed, or
overdrawn
A State chart diagram shows the life cycle of a single object, from the time that it is
created until it is destroyed
Software Engineering - H.A.
Elements of State Chart Diagram
12
Event: An event is something that causes a transition from one state to another to occur
The transition arrow is labeled with the event name, along with any arguments in parenthesis
An automatic transition, which has no event, an object automatically moves from one state to another
as soon as all the entry actions, activities, and exit actions have occurred
If a guard condition is present, it must be true in order for the transition to occur
The guard condition is listed along the transition arrow, following any event, and is
enclosed in square brackets
Data-driven models show the sequence of actions involved in processing input data and
generating an associated output.
Data-flow diagrams (DFDs) are system models that show a functional perspective where
each transformation represents a single function or process.
DFDs are used to show how data flows through a sequence of processing steps. For
example, a processing step could be the filtering of duplicate records in a customer
database. The data is transformed at each step before moving on to the next stage. These
processing steps or transformations represent software processes or functions where data-
flow diagrams are used to document a software design.
Software Engineering - H.A.
Data Models
Data flow diagrams (DFDs) may be used to model the system’s data
processing
These show the processing steps as data flows through a system.
DFDs are an intrinsic part of many analysis methods
Simple and intuitive notation that customers can understand.
Show end-to-end processing of data
Data Flow Diagrams
Data flow diagrams may also be used in showing the data exchange
between a system and other systems in its environment.
Data Flow Notations
20
Data flow from a process to a data store means update (insert, delete
or change)
Bidirectional flow
between process and
data store is
represented by two
separate arrows.
Context DFD
Overview of the organizational system
Level 0 DFD
Representation of system’s major processes at high level of abstraction
Level 1 DFD
Results from decomposition of Level 0 diagram
Level n DFD
Results from decomposition of Level n-1 diagram
Software Engineering - H.A.
Context Diagram
29
Context diagram shows the system boundaries, external entities that interact with the
system, and major information flows between entities and the system
symbol, and
The conservation of inputs and outputs to a data flow process when that
process is decomposed to a lower level
Balanced means:
Number of inputs to lower level DFD equals number of inputs to associated
process of higher-level DFD
Number of outputs to lower level DFD equals number of outputs to associated
process of higher-level DFD
1 input
1 output
2 inputs
1 output
1 input
3 outputs
A composite data
flow at a higher level
may be split if
different parts go to
different processes in
the lower level DFD.