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 you can implement additional decorators if you 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.

At a minimum, each group must use the Decorator Pattern for one of the following:

In each case, the decorator should include modifying the image to capture the changes or differences. If you used the Strategy Pattern in the previous lab for your chosen modification, you will need to remove the Strategy Pattern code, or choose a different modification.

As stated above, your group must implement at least one of the decorators in the previous group. Your group could implement multiple ones, or they could use the Decorator Pattern to introduce one or more of the following:

Each student in the group must implement at least one, distinct decorator. When applying the decorator pattern, do not forget that the object being decorated must be an interface class. Suppose your interface has concrete implementations A and B, and suppose A and B have common methods. You could create an abstract class derived from the interface and derive A and B from that abstract class; this would give you somewhere to put the common method. In addition, be sure the generic decorator has “decorator” in the class name to make it obvious where you are applying the pattern.

Submission