Вы находитесь на странице: 1из 7

Quiz

Solution

Question 1

From the question we can we can identify the following
domain elements:

1. Meal
2. French Fries
3. Toys such as Car Toy, Plane Toy…
4. Cold Drinks such as Coca Cola, Fanta…
5. Burgers such as Veg Burger, Chicken Burger…
6. Receipt
7. Chef
8. Order

This problem is an example of Point of Sale with emphasis
on creation of a Happy Meal. In a general scenario, the
customer goes to the order counter and asks the person on
the counter (cashier) to take an order. The cashier then
asks the customer about the items which he/she would
like to be in his/her order. For limiting the scope of
solution, the person can only give one order at a time and
one order can only contain one Happy Meal. The cashier
then calculates the amount to be paid by customer and
accepts the payment. The order is then passed to the chef,
the chef progressively builds the meal. After the chef
builds the meal, it is passed to the customer.




Analysis

Use Cases:

• Process_TakeOrder
o Primary Actor: Cashier
o Preconditions: Customer is able to buy a Meal and
Meal items are available.
o Post conditions: Order is successfully processed
and payment is received by the cashier, Meal is
handed over to the customer.
o Includes Use Case: Process_GetPayment
o Description:
§ Customer approaches cashier to take his
order.
§ Cashier asks the customer about the items to
be included in the meal.
§ Cashier accepts the payment.
§ The order is passed to the chef.
§ The chef creates the meal one item at a time
and then it is passed to the customer.

• Process_TakePayment







Use Case Diagram







Domain Model








System Sequence Diagram





Design

The problem gives hints us to use creational patterns as
creation of meal is involved. Two main creational patterns
we know are Builder and Factory. If we use Factory we
can delegate the creation of different types of burgers, cold
drinks, toys. But for creation of a meal we need a pattern
which can facilitate a sequential creation of an object, this
can be achieved by Builder. We use both the patterns to
solve our problem, Builder to facilitate the creation of the
meal and Factory for creation of items of a meal.


Sequence Diagram



Sequence diagram for choose burger is only shown to
keep the diagram clean, choose toy, choose cold drink and
add fries will be similar. To facilitate payment there is a
separate system. Focus of the problem is on creation of the
meal.

Class Diagram











If you are unable to understand the diagrams use the
following links for full size images:

• Use Case Diagram:
https://amanshuraikwar.github.io/res/sdp/ucd.png
• Domain Model:
https://amanshuraikwar.github.io/res/sdp/dm.png
• System Sequence Diagram:
https://amanshuraikwar.github.io/res/sdp/ssd.png
• Sequence Diagram:
https://amanshuraikwar.github.io/res/sdp/sd.png
• Class Diagram:
https://amanshuraikwar.github.io/res/sdp/cd.png

Вам также может понравиться