Designing a sequence diagram for an auction system

667 views
Skip to first unread message

methuselah90

unread,
Oct 2, 2014, 3:22:49 PM10/2/14
to umlf...@googlegroups.com
I'm currently working on a sequence diagram for an auction system which acts as the middleman between customers and companies.

However I'm having difficulty with the design of the system and would appreciate some guidance, especially as I seek to tighten up the UML diagram.

The entire idea behind the system is that the customer creates a booking via a mobile app which uploaded to the auction app where companies can bid for it. If a company wins a bid, the auction app gives them a price range in which they can give the customer a quote (i.e. if company A wins a bid to mow customer X's lawn, then the auction app sets a price range of $15-$20 for the job, and company A's quote has to be in between that range). The customer can then accept the quote and go ahead with the job or reject it.

Steps are as follows:

 1.   Customer creates a booking on booking app
 1.1  Booking app saves booking (recursive as customer can save more than one 
      booking)
 1.2  Job is uploaded to auction app where other companies can bid for it. In the 
      next step, a company will bid for job.

 In the event of an unsuccessful bid:

 2.   Company makes bid for job on auction application
 2.1  Message sent to company telling them that they failed to win the job

 In the event of a successful bid:

 3.   Company makes bid for job on auction application
 3.1  Message sent to company telling them that they won the job
 4.   Auction app sends price limit message for the job that the company has just 
      won (to prevent overcharging). In the next step, the company needs to set a 
      quote

 In the event that a customer rejects a set quote    

 5.   Company sets quote for the job that they won
 5.1  Auction app sends the quote message to the auction app
 6.   Quote displayed to customer on mobile application
 7.   Customer rejects the quote
 7.1  The rejection message is sent to the auction app
 8.   The rejection message is displayed to the company

 In the event that a customer accepts a set quote 

 9.   Company sets quote for the job that they won
 9.1  Auction app sends the quote message to the auction app
 10.  Quote displayed to customer on mobile application
 11.  Customer accepts the quote
 11.1 The acceptance message is sent to the auction app
 12.  The acceptance message is displayed to the company
 13.  End booking process

This is the UML diagram:

I have 3 questions:

1. When BidSuccess=False (i.e. a company's bid for a job has failed), they can opt to bid for another job and win (therefore entering the BidSuccess=True branch). Is it possible to convey this on the sequence diagram. If so, then how?
2. There appears to be a lot of redundancy in steps 5-13, could the sequence diagram be better designed here? How would I go about merging 5,5.1,6 and 9,9.1,10 but letting them return different results depending on CustomerAcceptQuote.
3. Perhaps my biggest concern is whether or not I've put the loop/alt guards in place. I think I have used them correctly but please correct me if they are not.

RJB

unread,
Oct 4, 2014, 7:40:53 PM10/4/14
to umlf...@googlegroups.com
1. Perhaps I misremember, but isn't 'alt' a part of a 'sel' and not a 'loop', and not freestanding?

2. Because UML sequence diagrams are "structured" -- goto-free -- some natural patterns of interaction (the famous loop-and-a-half) are surprisingly complicated to express.

H. S. Lahman

unread,
Oct 5, 2014, 12:29:07 AM10/5/14
to umlf...@googlegroups.com
Responding to methuselah90...

Unfortunately, I am a little confused about what this application is doing. That may be due to the terminology used, so I have a number of questions.

The main question is about what kind of auction this is. From your lawn-mowing example, I would assume that it was not a competitive auction where bidders continue to bid against one another until there was a winner.  That is, bidders simply placed a bid and the customer selects among them. However, your steps and diagram suggest the companies do bid against one another (3/3.1 happen without the Customer seeing the bid). The rest of my questions are inline...


Steps are as follows:

 1.   Customer creates a booking on booking app
 1.1  Booking app saves booking (recursive as customer can save more than one 
      booking)

Just to be clear, a Customer may have more than one job active where the Customer is seeking quotes, right?


 1.2  Job is uploaded to auction app where other companies can bid for it. In the 
      next step, a company will bid for job.

 In the event of an unsuccessful bid:

 2.   Company makes bid for job on auction application
 2.1  Message sent to company telling them that they failed to win the job

Given the 5+ activities, I am confused about what an unsuccessful bid is. Is this just an error in the Company entering a bid (e.g., it is out of range)? If not, why would the Company fail to win the job when the Customer never sees the bid prior to issuing 2.1?

In your diagram, this is a loop. Why? It is because of bid entry errors or because the same Company is bidding iteratively against other companies? Or is it because the Company may be bidding on different jobs? (If it is the last, then it is not relevant because the SD shows a single causal thread of activity.)



 In the event of a successful bid:

 3.   Company makes bid for job on auction application
 3.1  Message sent to company telling them that they won the job

What does it mean that they have "won the job"? How can that happen before the Customer accepts the quote (11)?


 4.   Auction app sends price limit message for the job that the company has just 
      won (to prevent overcharging). In the next step, the company needs to set a 
      quote

Why isn't the price limit part of the booking description (1)? Surely that is something the Company needs to know before before deciding whether to make a bid.

If there is a valid reason for this, then why isn't it part of 3.1?



 In the event that a customer rejects a set quote    

 5.   Company sets quote for the job that they won

This is where I really get confused. How can the Company make a bid (2) that doesn't have a quote? What other criteria is there for a successful/unsuccessful bid?


 5.1  Auction app sends the quote message to the auction app
 6.   Quote displayed to customer on mobile application
 7.   Customer rejects the quote
 7.1  The rejection message is sent to the auction app
 8.   The rejection message is displayed to the company

This is described in the diagram as a loop. Is the intent simply to capture the fact that the Customer may have several jobs out for bid? If so, it is irrelevant since the SD shows a single processing thread. Otherwise, I don't understand why there would be any sort of iteration.



 In the event that a customer accepts a set quote 

 9.   Company sets quote for the job that they won
 9.1  Auction app sends the quote message to the auction app
 10.  Quote displayed to customer on mobile application
 11.  Customer accepts the quote
 11.1 The acceptance message is sent to the auction app
 12.  The acceptance message is displayed to the company
 13.  End booking process

Essentially the same question applies here about the loop.

Aside from the issue about the difference between making a bid and setting a quote, it seems to me the Customer's acceptance/rejection (5-13) could be handled more simply via conditional messages:

<pre>
Customer           Booking App          Auction App           Company
    |                    |                   |                    |
    |                    |                   |      SetQuote      |
    |                    |                   |<-------------------|
    |                    |    QuoteMsg       |                    |
    |                    |<------------------|                    |
    |  DisplayQuote      |                   |                    |
    |<-------------------|                   |                    |
    |                    |                   |                    |
    | [Reject]RejectMsg  |                   |                    |
    |------------------->|                   |                    |
    |                    |                   |                    |
    | [Accept]AcceptMsg  |                   |                    |
    |------------------->|                   |                    |
    |                    |   ResponseMsg     |                    |
    |                    |------------------>|     ResponseMsg    |
    |                    |                   |------------------->|
</pre>

In this case the Booking and Auction applications are just relaying the Customer's response back to the Company without dealing with the content at all.

Note that you could do the same thing with the Bid sequences by making 2.1, 3.1, and 4 conditional as well.

-- 
A man is drinking beer on his porch with his wife. He: I love you. She: Is that you or the beer talking? He: It's me talking to the beer.

Life is the only flaw in an otherwise perfect nonexistence
   -- Schopenhauer

Imagine how much more difficult physics would be if electrons had feelings
   -- Richard Feynman

Rene Descartes went into a bar. The bartender asked if he would like a drink. Descartes said, "I think not," and disappeared.

Entropy isn't what it used to be.
   -- mwalshe89

Is it solipsistic in here, or is it just me?

H. S. Lahman
H.la...@verizon.net
website: http://www.hslahman.com/
software blog: http://pathfinderpeople.blogs.com/hslahman/index.html
software book: Model Based Development, Addison-Wesley, 2011
geology book: The Evolution and Utilization of Marine Resources, MIT Press, 1972

Reply all
Reply to author
Forward
0 new messages