CSE373: Data Structures & Algorithms Lecture 17: Shortest Paths Nicki Dell Spring 2014.
Data Flow Diagrams A structured analysis technique that employs a set of visual representations of...
-
Upload
isabella-lawson -
Category
Documents
-
view
216 -
download
0
Transcript of Data Flow Diagrams A structured analysis technique that employs a set of visual representations of...
Data Flow Diagrams
A structured analysis technique that employs a set of visual representations of the data that moves through the organization, the paths through which the data moves, and the processes that produce, use, and transform data.
2
Why Data Flow Diagrams?
• Can diagram the organization or the system
• Can diagram the current or proposed situation
• Can facilitate analysis or design
• Provides a good bridge from analysis to design
• Facilitates communication with the user at all stages
Types of DFDs
• Current - how data flows now
• Proposed - how we’d like it to flow
• Logical - the “essence” of a process
• Physical - the implementation of a process
• Partitioned physical - system architecture or high-level design
Levels of Detail
• Context level diagram - shows just the inputs and outputs of the system
• Level 0 diagram - decomposes the process into the major subprocesses and identifies what data flows between them
• Child diagrams - increasing levels of detail
• Primitive diagrams - lowest level of decomposition
Four Basic Symbols
Source/Sink
Data Flow
#
Process# Data Store
Context Level Diagram
• Just one process
• All sources and sinks that provide data to or receive data from the process
• Major data flows between the process and all sources/sinks
• No data stores
Running Example
Course Registration: Context level Diagram
0
CourseRegistration
System
Student
Registrar
Professor
Class Request
Payment
Receipt
Student Schedule
Class roster
Enrollmentstatistics
Modeling Dilemma: Scope
• Deciding whether an entity is an external source/sink or an integral part of the system
• E.g. users of the system, managers who oversee the process
• Does the entity simply provide or receive information, or do they perform some part of the process?
Level 0 Diagram
• Process is “exploded”
• Sources, sinks, and data flows repeated from context diagram
• Process broken down into subprocesses, numbered sequentially
• Lower-level data flows and data stores added
Running Example
Course Registration: Current Logical Level 0 Diagram
Student RegistrarProfessor
1.0
RegisterStudent for
Course
D1 Student Class Records
D2 Student Payments
2.0
CollectStudent Fee
Payment
3.0
ProduceStudent
Schedule
4.0
ProduceClassRoster
5.0
ProduceEnrollment
Report
PaymentInformation
Student andCourse Data
StudentClass Record
Student Class Record Student Class Record
Student Class Record
Student Schedule Class RosterEnrollment
Report
StudentClass Request
Receipt
Payment
Child Diagrams
• “Explode” one process in level 0 diagram• Break down into lower-level processes, using
numbering scheme• Must include all data flow into and out of
“parent” process in level 0 diagram• Don’t include sources and sinks• May add lower-level data flows and data
stores
Running Example
Course Registration: Current Logical Child Diagram
1.2
Checkfor
Availability
1.1
CheckPrerequisites
Met
1.3
EnrollStudentin Class
D1 Student Class RecordsD5 Course CatalogueD4 Student Transcripts
D3 Semester Schedule
Class Request Valid ClassRequest
Feasible ClassRequest
Available Seats
Available Seats
StudentRecord
Course RecordStudent
and CourseData
Error
Error
Physical DFDs
• Model the implementation of the system
• Start with a set of child diagrams or with level 0 diagram
• Add implementation details– indicate manual vs. automated processes– describe form of data stores and data flows– extra processes for maintaining data
Running Example
Course Registration: Current Physical Child Diagram
1.2
Checkfor
Availability(myUMBC)
1.1
CheckPrerequisites
Met(manual)
1.3
EnrollStudentin Class
(STARS)
D1 Semester Enrollment DBD5 Course Catalogue (text)D4 Department Student File
D3 Semester Schedule DB
Class Request AdvisementAuthorization
Feasible ClassRequest
Available Seats
Available Seats
Studentand Course
Data
Student Notified(verbally)
UnavailabilityMessage
StudentFile
Course Description
Running Example
Course Registration: Proposed Physical Child Diagram
1.2
Checkfor
Availability(automated)
1.1
CheckPrerequisites
Met(automated)
1.3
EnrollStudentin Class
(automated)
D1 Semester Enrollment DBD5 Course Catalogue DBD4 Registrar’s Student DB
D3 Semester Schedule DB
Class Request AuthorizedClass Request
Valid ClassRequest
Available Seats
Available Seats
Studentand Course
Data
Student Notified(email)
StudentEmailed
StudentRecord
Course Record
Partitioning a physical DFD
• Part of system design
• System architecture– high-level design– overall shape of system– some standard architectures
• Decide what processes should be grouped together in the system components
Running Example
Course Registration: Physical diagram (partitioned)
1.2
Checkfor
Availability(automated)
1.1
CheckPrerequisites
Met(automated)
1.3
EnrollStudentin Class
(automated)
D1 Semester Enrollment DBD5 Course Catalogue DBD4 Registrar’s Student DB
D3 Semester Schedule DB
Class Request AuthorizedClass Request
Valid ClassRequest
Available Seats
Available Seats
Studentand Course
Data
Student Notified(email)
StudentEmailed
StudentRecord
Course Record
Balancing
• Most important rule in data flow diagramming
• Every child diagram must include the same inputs and outputs as the process it represents in its parent diagram
• Also applies to the level 0 diagram
• Checking for balancing is a good way to find errors and omissions in your DFDs
1.0
GetCustomerAddress
CustomerInformation Customer
Address
1.2
ExtractCustomerAddress
1.1
LookupCustomer
Entry
CustomerInformation Customer
RecordCustomerAddress
1.2
ExtractCustomerAddress
1.1
LookupCustomer
Entry
CustomerInformation
CustomerRecord
CustomerZip Code
DirectoryName
DirectoryName
Balancing Exceptions
• A data flow at one level may be decomposed at a lower level
• On low-level DFDs, new data flows can be added to represent exceptional situations
• All data coming into and out of a process must be accounted for
1.0
GetCustomerAddress
CustomerInformation
CustomerAddress
1.2
LookupCustomerAddress
1.1
GetCustomer
Phone
1.3
RequestCustomerAddress
CustomerPhone
CustomerAddress
CustomerPhone
CustomerAddress
1.0
GetCustomerAddress
CustomerInformation
CustomerAddress
1.2
LookupCustomerAddress
1.1
GetCustomer
Phone
1.3
RequestCustomerAddress
CustomerPhone
CustomerAddress
CustomerPhone
CustomerAddress
Invalid PhoneNumber Message
Another Example
Perfect Pizza: Context Level Diagram
0
CustomerOrder
System
Customer
Cook
Management
Phone Number
Customer Order
Customer Info
DeliveryInformation
WeeklyReport
Cook OrderDeliveryPerson
Another Example
Perfect Pizza: Current Logical Level 0 Diagram
1.0Find
CustomerRecord
7.0Print
WeeklyTotals
6.0SendOrder
to Cook
5.0Add
CustomerRecord
2.0Take
CustomerOrder
3.0Print
DeliveryOrder
Customer
CustomerInfo
PhoneNumber
Customer Order
D1 Customer Master
CustomerRecord
CustomerRecord
CustomerInformation
D2 Customer History
D3 Sales Records
OrderInformation
OrderInformation
CustomerHistory
DeliveryInformation
CustomerCustomerOrder
Cook
CookOrder
Management
Sales Info
Weekly Report
DiscountInfo
DeliveryPerson
Another Example
Perfect Pizza: Current Logical Child Diagram
3.1
DetermineCustomerDiscount
3.2
RecordDiscount
3.3
PrintDelivery
Instructions
OrderInformation
DiscountAmount
DeliveryInformation
D2 Customer History
D3 Sales Records
CustomerHistory
DiscountInformation
CustomerInformation
Another Example
Perfect Pizza: Current Logical Child Diagram
5.1
RecordCustomer
Information
5.2
StoreCustomer
Record
D1 Customer Master
Customer Information RawCustomer
Information
CustomerRecord
Another Example
Perfect Pizza: Physical Child Diagram
5.3Clerk
VisuallyConfirmsCust. Info.
5.1Clerk Types
CustomerInformation
5.2System
ValidatesCustomer
Information
5.4Format
CustomerRecord
PhonedCustomer
InformationRecordedCustomer
Information
Valid CustomerInformation
SyntaxErrors
CancelledTransaction
New CustomerInformationD1 Customer DB
CustomerRecord
PhoneNumber
Another Example
Perfect Pizza: Current Physical Level 0 Diagram
1.0Clerk FindsCustomer
Row
7.0Mgr Prints
WeeklyTotals(batch)
6.0Clerk Sends
Orderto Cook(paper)
5.0Clerk AddsCustomer
Row
2.0Clerk TakesCustomer
Order(by phone)
3.0System Prints
DeliveryOrder
Customer
PhonedCustomer
Info
PhoneNumber
PhonedCustomer Order
D1Customer Spreadsheet
CustomerRecord
CustomerRecord
CustomerInformation
D2 Customer History DB
D3 Sales Records File
Copy ofOrder Slip
Customer& Order
Info
CustomerHistoryRecord
DeliveryPrintout
Customer
CookCopy of
order slipManagement
Copies ofOrder Slips
Weekly ReportPhone #
Cust.Info.
DeliveryPerson
8.0Mgr Updates
CustomerHistory
(nightly)Copies of
Order Slips& Del. Printouts
CustomerHistoryRecord
PhonedCustomer
Order
Another Example
Perfect Pizza: Proposed Physical Level 0 Diagram
1.0System Finds
CustomerRecord
7.0System Prints
WeeklyTotals(batch)
5.0Clerk AddsCustomer
Record
2.0Clerk Enters
CustomerOrder
(by phone)
3.0System Prints
DeliveryOrder
Customer
PhonedCustomer
Info
PhoneNumber
PhonedCustomer Order
D1 Customer DB
CustomerRecord
CustomerRecord
CustomerInformation
D2 Customer History DB
D3 Sales DB
OrderInfo
OrderInfo
CustomerHistoryRecord
DeliveryPrintout
Cook Management
SalesRecords
Weekly ReportPhone #
Cust.Info.
DeliveryPerson
D3 Sales DBOrderInfo
DiscountInfo
Another Example
Perfect Pizza: Partitioned Physical Level 0 Diagram
1.0System Finds
CustomerRecord
7.0System Prints
WeeklyTotals(batch)
5.0Clerk AddsCustomer
Record
2.0Clerk Enters
CustomerOrder
(by phone)
3.0System Prints
DeliveryOrder
Customer
PhonedCustomer
Info
PhoneNumber
PhonedCustomer Order
D1 Customer DB
CustomerRecord
CustomerRecord
CustomerInformation
D2 Customer History DB
D3 Sales DB
OrderInfo
OrderInfo
CustomerHistoryRecord
DeliveryPrintout
Cook Management
SalesRecords
Weekly ReportPhone #
Cust.Info.
DeliveryPerson
D3 Sales DBOrderInfo
DiscountInfo