SWE 2410, Lab 5: Decorating the Garden

For this lab, you will introduce the Decorator Pattern into the bees and garden system you wrote for the previous lab. Each team member must introduce at least one decorator, but a team member can implement additional decorators if they like. Be sure to fix issues identified in the previous lab as well. The intent is that this would be done using the same groups as the previous lab; if this would be difficult for you, talk to your instructor as soon as possible.

Members will pick one of the following features to implement using the Decorator Pattern. In each case, there must be multiple, distinct decorators, and decorators must be able to decorate both the base object and decorated objects.

If you have alternative ideas, feel free to discuss them with your instructor. Alternatives must be approved. Use Teams or email to present the alternative so you get a written approval.

All decorators must have the following properties:

The intent is that all decorators would be determined at object creation time. It is possible to use the decorator pattern with objects that change state, but this introduces significant complexities. In particular, you will need a “dummy” object that holds the primary reference to the decorated object. If you are interested in doing the extra work, discuss it with your instructor.

Each student in the group must implement at least one, distinct decorator. When applying the Decorator Pattern, you must use the word Decorator in the class names of all decorators; this allows instructors to identify where you have applied the pattern. In addition, follow the notes and make sure the class being decorated is an interface class. This introduces two issues:

Submission