Question
Please solve this for composite/decorator design pattern. (Please draw the diagrams on a paper as they are hard to understand with a typed-out diagram.) Suppose
Please solve this for composite/decorator design pattern. (Please draw the diagrams on a paper as they are hard to understand with a typed-out diagram.)
Suppose you are a software designer for Connie's Pizza Parlour. Connie's Pizza Parlour has several menus (at this time: salad, pizza, wrap, appetizer, lunch, dinner, evening, dessert). Menus may be combined: for example, the lunch menu comprises the salad, pizza, and dessert menus (a menu may include other menus plus other items). Regardless of ordering a salad or a pizza, the additional ingredients that you can request are the same: tomato, cheese, chicken. Connie's Pizza Parlour will prepare a pizza on a pizza crust and cook it for you, but a salad will be prepared in a bowl. As a sample order, Peter Parker ordered a salad with tomatoes, a pizza with tomatoes and cheese, and a piece of cheese cake for lunch.
Connies Pizza Parlour wants you to design a set of software classes organized using the Composite and/or Decorator patterns that will enable her customers to place orders. At this time the menus contain only pizzas, salads, and toppings (e.g. tomato, cheese, chicken) later on more menus, items, and toppings will be added. The software must allow the customer to place an order and to be informed of the price. Each pizza and salad has a basic price which increases according to the type of ingredients that are added. We know that all objects must implement price() and description(). The cost and description of a salad or pizza requires the collaboration of associated objects.
a) Illustrate the class diagram.
b) Show in a sequence diagram how a pizza with tomato and double cheese would be instantiated.
c) Show in a sequence diagram how the price of a pizza with tomato and double cheese would be determined.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started