Question: Overview: Decorator is a structural pattern that allows adding new behaviors to objects dynamically by placing them inside special wrapper objects. Using decorators, you can

Overview: Decorator is a structural pattern that allows adding new behaviors to objects dynamically by placing them inside special wrapper objects. Using decorators, you can wrap objects countless number of times since both target objects and decorators follow the same interface. Task: Let's say that Starbucks has several orders and the main order is coffee (decorate class), and the there are several customers order required such as americano, coffee latte, espresso and cappuccino (Concrete class) the customer needs to know their order description, cost Objectives Create UML class diagram for decorate pattern to display classes of Starbucks caf with customer order In java code, Create classes and all attributes and methods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
