Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Data Modeling
• Identify the following items
– Data objects (Entities)
– Data attributes
– Relationships
– Cardinality (number of occurrences)
2
Data Flow and Control Flow
3
Diagram Layering and Process
Refinement
Context-level diagram
Level 1 diagram
4
Process Specification
Scenario-based Modeling
Writing Use Cases
• Writing of use cases was previously described in
Chapter 7 – Requirements Engineering
• It is effective to use the first person “I” to describe how the actor
interacts with the software
• Format of the text part of a use case
Use-case title:
Actor:
Description: I …
Cook
Notify customer that
food and drink are ready
Customer
8
Example Activity Diagram
Set counter = positive n
Set accumulator = initial value
F
n>1
T
Set accumulator = accumulator * n
Set n = n - 1
F (n mod 5) == 0
T
Display accumulator value
9
Return accumulator value
Class-based Modeling
Example Class Box
Class Name Component
+ componentID
- telephoneNumber
Attributes - componentStatus
- delayTime
- masterPassword
- numberOfTries
+ program()
+ display()
Operations + reset()
+ query()
- modify()
+ call()
11
Example Class Diagram
Accountant Auditor Record
Keeper
Report
Error Log Input Handler Account Account List
Generator
1..n
12
Behavioral Modeling
Creating a Behavioral Model
1) Identify events found within the use cases and implied by the
attributes in the class diagrams
2) Build a state diagram for each class, and if useful, for the whole
software system
14
Identifying Events in Use Cases
• An event occurs whenever an actor and the system exchange
information
• An event is NOT the information that is exchanged, but rather the fact
that information has been exchanged
• Some events have an explicit impact on the flow of control, while
others do not
– An example is the reading of a data item from the user versus comparing
the data item to some possible value
15
Building a State Diagram
• A state is represented by a rounded rectangle
• A transition (i.e., event) is represented by a labeled arrow leading from
one state to another
– Syntax: trigger-signature [guard]/activity
• The active state of an object indicates the current overall status of the
object as is goes through transformation or processing
– A state name represents one of the possible active states of an object
• The passive state of an object is the current value of all of an object's
attributes
– A guard in a transition may contain the checking of the passive state of an
object
16
Example State Diagram
pop / set n to 0; return error push [n – 2 < max]
push [n = 0]
Empty Partially pop [n > 1]
Stack Filled Stack
pop [n = 1]
Full Stack
17
Behavioral Modeling
• One of the fundamental principles for all
requirements analysis methods
• STD represents the behavior of the system
• It depicts the states and the events that
cause the system to change state.
State Transition Diagrams
• A State is any observable mode of behavior
– e.g., reading commands, computing control, waiting for next time
event
• E.g. states for a monitoring and control system for pressure
vessel is monitoring state, alarm state, pressure release state
…….
Scenario-based Flow-oriented
modeling modeling
Use case text
Data flow diagrams
Use case diagrams
Control-flow diagrams
Activity diagrams
Processing narratives
Swim lane diagrams
Class-based Behavioral
modeling modeling
Class diagrams
State diagrams
Analysis packages
Sequence diagrams
CRC models
Collaboration diagrams
20
Data Flow Diagrams (DFDs) - continued
(2) Process or
or
(4) Data Flow
Process
A data transformer (changes input
to output)
Student ID
CGPA
Compute
CGPA
student data
• Simple rules:
– left to right, top to bottom, basically (like
English)
– Show all processes
– data flows must start or end in a process
– beware of black holes - every process and data
store must produce data
– no “magic processes” - must enter all needed
data to get data out
Example
In the following example, a DFD will be created based on a paragraph
about Bebop Records Co.’s method of receiving and filling orders.
FIRST SENTENCE:
Bebop Records is a mail-order company that distributes CDs and tapes at
discount price to record-club members.
Bebop Records
DFD Example - Step 2
SECOND SENTENCE:
When an order processing clerk receives an order form, he or
she verifies that the sender is a club member by checking
the Member file.
Customer
(non-member)
DFD Example - Step 3
THIRD SENTENCE:
If the sender is not a member, the clerk returns the order along with a
membership application form.
Customer
(non-member)
Non member order
And application form
DFD Example - Step 4
FOURTH SENTENCE:
If the customer is a member, the clerk verifies the order item data by
checking the Item file.
Customer
(non-member)
Verify Item Item Master
Order data
Item data
DFD Example - Step 5
FIFTH SENTENCE:
Then the clerk enters the order data and saves it to the Daily Orders file.
RESULT:
DFD Example - Step 5 continued
RESULT: Bebop Records Order Processing
Customer
(non-member)
Verify Item Item Master
Order data
Item data
Verified
Member
order
Enter order
Into Daily order Daily orders detail
orders
DFD Example - Step 6
SIXTH SENTENCE:
The clerk also prints an invoice and shipping list for each order, which are
forwarded to Order Fulfillment.
RESULT:
DFD Example - Step 6 continued
RESULT: Bebop Records Order Processing
1.0
Record Club order Verify
Member Member Member Master
Member data
Status
2.0
Verify Item Item Master
Customer
Order data
(non-member)
Item data
Verified
Member
3.0order
Enter order order Daily orders detail
Into Daily
orders
Order
4.0 data
Print
Invoice Invoice and Order
And shipping Shipping list fulfillment
list