A booking sequence diagram uses the alt fragment shown below. A guard is a condition that determines whether an alternative is eligible to execute. Here, sss is the number of available seats, rrr is the number requested, and aaa is true when payment is authorised and false otherwise. The values stay unchanged while the guards are evaluated.
For each independent run, enter the selected message name: reserve, requestAuth or reject. Omit parentheses. Each operand contains only the outgoing call shown.
Unlock full course notes by signing up
Ordering messages traced from code
The Python code below runs when a Client object calls place(cart) on an OrderService. The attributes pricing, tax, payments and mailer refer to separate Pricing, TaxTable, Payments and Mailer objects, and every call except send_receipt is synchronous. Arrange the messages in the order they appear from top to bottom of the sequence diagram for this call, ignoring the final reply from OrderService to Client.
Cost of a chatty synchronous design
A mobile app's CartScreen displays 8 items. In the current design, a sequence diagram shows a loop fragment over the items in which CartScreen sends the synchronous call getPrice(id) to a remote PriceService and receives a reply. Each round trip, including server processing, takes 40 ms, the calls are made one after another, and CartScreen does nothing else while it waits. In a proposed design, CartScreen sends one synchronous call getPrices(ids) and receives one reply, and that single round trip takes 70 ms. Give each answer as a whole number: the number of messages exchanged between CartScreen and PriceService in the current design, the total time CartScreen is blocked in the current design in ms, the number of messages exchanged in the proposed design, and the blocked time saved by the proposed design in ms.
Counting messages with an opt fragment nested in a loop
A sequence diagram for placing an order shows the following. OrderController sends the synchronous call validate(order) to Validator and receives a reply. A loop fragment with the guard [for each line item] then contains the synchronous call reserve(sku, qty) from OrderController to Inventory and its reply; nested inside the loop, after that reply, an opt fragment with the guard [stock below reorder level] contains the asynchronous signal reorder(sku) from Inventory to Supplier. After the loop, OrderController sends the asynchronous signal confirm(order) to Mailer. An order has 6 line items, and reserving 2 of them leaves stock below the reorder level. How many messages, including replies, appear in this run? Give your answer as a whole number.
Counting permitted asynchronous event traces
Two sensors send telemetry to two separate logger instances. Sensor a sends asynchronous message mmm to logger b, and sensor c sends asynchronous message nnn to logger d. All four participants are distinct. The sequence diagram uses default weak sequencing, with no additional ordering or timing constraints.
An event trace is a total ordering of the four send and receive events. Write these events as sms_msm, rmr_mrm, sns_nsn and rnr_nrn, where sss denotes sending and rrr denotes receiving. Count different total orderings separately and do not include simultaneous events. There are no replies or other events.
Find both quantities as exact integers: