For this exercise you are given Java code that has been poorly engineered. Your task is to examine the code and refactor it to use a specific design pattern.
You should use your favorite tool (or a legible drawing on paper or a whiteboard) to create a UML Object Diagram of the system before you begin refactoring. Unlike a class diagram, which includes only one instance of each class, an Object Diagram shows the objects that have been instantiated in a system at a certain time. An Object Diagram will potentially include many instances of the same class, and will show the coupling between each instance and other other objects that it uses.
Once you have refactored the design to use the required design pattern, complete the GoF pattern card in the refactoring design document. Remember to use context specific names for your classes (i.e. avoid using names like "Context," "Client," "Subject," etc.). You should also write at least 2-3 sentences describing each class's role in the pattern within the context of this system; do not use generic descriptions of the class roles in the pattern (i.e. "This class is the observer," or "This class is the client.").
Create a UML diagram of your refactored subsystem. Your diagram should completely capture all of the relationships between classes in the subsystem using proper UML notation. Be sure to include the pattern stereotype for any class that is playing a role in the design pattern by including the name of the role in guillemets beneath the name of the class, e.g. <<Context>>
Include another UML Object Diagram of the refactored system after you have refactored the design to use Mediator.
Unlike the other refactoring exercises, you do not need to refactor the provided source code. You are free to do so as a learning exercise, but do not submit the refactored source. You only need to submit your design.
The software that you have been given is an elevator control system similar to the one discussed as an example during the Mediator lecture. This system has been naively implemented to use the Observer pattern to naively connect buttons and elevators to each other. A more realistic system would also include bells, lights, and doors on each floor, but this system has been purposely simplified.
Download the ZIP file containing the source code for the current subsystem. There is no executable provided with this code. You are not expected to compile, run, or refactor the provided code. Instead, simply analyze the current system to complete your refactored design.
By the time specified in the course schedule, submit your refactored design document to the Mediator Refactoring dropbox. Remember, you are not required to refactor the source code for this assignment.