Uml sequence and activity diagram
Budget: $10 – $30 CAD
1) Happy Hour Message
Draw a sequence diagram for the HappyHourMessage scenario in the figure below. Draw only the first five messages exchanged.
Solution:
Scenario name Participating actor instances
HappyHourMessage
bob, alice: BarFlies john: Friend
Flow of events
1. Bob and Alice are sitting in their favorite pub and it’s happy hour.
They want to invite their common friend John who likes cocktails and didn’t know about the newly scheduled happy hour. Alice takes out her “mobile phone” and activates the “SMS” function.
2. Alice enters John’s cell phone number and writes the message about the happy hour into the “SMS text field”. She sends the message and waits for John’s answer.
3. John, who is still at work, is alerted by a sound of his cell phone that a new “SMS” has arrived. He reads the lines from Alice and answers that he will come immediately. He quits working and leaves the office.
4. Alice receives John’s answer at her “mobile phone”.
2) Model an online bookstore
Consider the process of ordering a book via Internet. Draw an activity diagram representing each step of the process, from the moment you open the shop’s web page to the point when you start reading the book, including login or registration. Include activities that others need to perform.
Add additional exception handling to the activity diagram you have developed. Model the following three exceptions:
1. The order got lost in the Internet
2. The wrong book is packaged
3. The ordered book is no longer available
Draw a sequence diagram for the HappyHourMessage scenario in the figure below. Draw only the first five messages exchanged.
Solution:
Scenario name Participating actor instances
HappyHourMessage
bob, alice: BarFlies john: Friend
Flow of events
1. Bob and Alice are sitting in their favorite pub and it’s happy hour.
They want to invite their common friend John who likes cocktails and didn’t know about the newly scheduled happy hour. Alice takes out her “mobile phone” and activates the “SMS” function.
2. Alice enters John’s cell phone number and writes the message about the happy hour into the “SMS text field”. She sends the message and waits for John’s answer.
3. John, who is still at work, is alerted by a sound of his cell phone that a new “SMS” has arrived. He reads the lines from Alice and answers that he will come immediately. He quits working and leaves the office.
4. Alice receives John’s answer at her “mobile phone”.
2) Model an online bookstore
Consider the process of ordering a book via Internet. Draw an activity diagram representing each step of the process, from the moment you open the shop’s web page to the point when you start reading the book, including login or registration. Include activities that others need to perform.
Add additional exception handling to the activity diagram you have developed. Model the following three exceptions:
1. The order got lost in the Internet
2. The wrong book is packaged
3. The ordered book is no longer available