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:
Modify the flower class(es) to use decorators to implement providing energy, draining energy, and varying the behavior over time.
Modify the bee class(es) to use decorators to capture how the bees move differently.
Introduce a pollinator bee that makes a flower “go to seed” so it no longer provides energy or drains energy from other bees.
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:
Add decorations to the garden in the form of trees and weeds. This would be controlled by the user in some reasonable way such as sliders indicating the number of each.
Modify the bee’s image to show that it has low energy and is about to perish. This could be shown visually by overlaying graphics or adding visual elements such as thermometers.
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.
Ensure that your user experience is still appropriate. This includes making it easy for your instructor to verify the new features in half a minute or so.
As for the previous lab, meet your instructor’s coding standard. At a minimum, your classes must include documentation about their responsibilities.
Push your changes to your Git repository, continuing to work on the main branch.
When you are finished, create a PDF
capturing what you accomplished. Your instructor may have specific requirements to meet, but if the instructor does not specify then your PDF must contain the following:
Main
class or JavaFX classes, and do not reverse-engineer your solution to create this diagram.See Canvas for any additional submission instructions.