Chapter 4 (Interaction Diagrams) - Sequence Diagrams, Collaboration Diagrams, Dfds
Chapter 4 (Interaction Diagrams) - Sequence Diagrams, Collaboration Diagrams, Dfds
INTERACTION DIAGRAMS
Areas to be covered:
Sequence diagrams
Collaboration diagrams
Data Flow diagrams
Introduction
Interaction diagrams:
Rules of Drawing:
• Represent the objects of the system that are interacting – internal objects (system modules), external objects (people),
using a normal rectangle, with the name of the object in it.
Name of object
• Flow of data using full arrow links or dotted arrow links if there is a conditional test.
• Include the name of the data being passed on top or below the arrow.
• Separate each object using a y-axis grid
Sequence Diagrams
Example
An e-commerce system works as follows. A customer checks products online, and if the product search is available,
he/she adds to cart and pays then confirms purchase by paying via mpesa or bank. The company is notified of the
payment details and a delivery agent is also notified of the customer’s residence and the product bought. The
delivery agent sends a confirmation to both the company and the customer that the product will be delivered at a
certain time. When the product is delivered, the customer can then give a review/rating of the service in the e-
commerce platform. If product was not found during product search, he/she can search other products/exit.
Draw a well-labelled sequence diagram to represent the system
Solution
Objects
- Customer
- Delivery agent
- Company
- Products
- Cart
- Payment
- Review
Sequence Diagrams
Customer Products Company Cart Purchase Delivery Review
agent
Product details
Product
Payment option
Customer’s
residence,
product
Payment details
Review/Rating
Collaboration Diagram
Product details
Customer
Product
Products
Payment option
Cart
Purchase Customer’s
Delivery
residence,
time
product
Delivery Company
agent
Reviews
Review/Rate
Data Flow Diagrams
• Used to represent the actors (users), the processing point of the system, the inputs and outputs between the actors
and the data stores
• The processing point represents the actual system which does everything – receiving inputs, working out computations,
giving outputs, and even updating the database
• Data stores are the data storage locations – database, sim card, table in a database
Rules of Representing: • Use straight lines to join actors and data stores to
• Represent an actor using a finite rectangle the processing point
Name of actor
• Use unidirectional arrows above/below the straight
• Represent the processing point, using an ellipse lines to show direction of input/output, and indicate
Processing the data/information
point
Name of Data Store
• Represent Data stores using parallel horizontal lines, with the name of the data store in between
Data Flow Diagrams
Example
An e-commerce system works as follows. A customer checks products online, and if the product search is available,
he/she adds to cart and pays then confirms purchase by paying via mpesa or bank. The customer gets a payment
notification. The company is notified of the payment details and a delivery agent is also notified of the customer’s
residence and the product bought. The system also updates list of items in stock. The delivery agent sends a
confirmation to both the company and the customer that the product will be delivered at a certain time. When the
product is delivered, the customer can then give a review/rating of the service in the e-commerce platform, and the
company can respond to the reviews. If product was not found during product search, he/she can search other
products/exit. All data (stock, payments, messages, reviews, etc) is managed from a database
Draw a well-labelled data flow diagram to represent the system
Solution
Processing point:
- E-commerce system
Actors:
- Customer
- Company
- Delivery agent
Data Stores:
- database
Data Flow Diagrams
Product search,
updating cart, Review
payment, responses
review
Customer Company
Products,
Payment notification, E-commerce Payment details,
delivery time, Review system delivery time
responses