SE-2030 Software Engineering Tools and Practices
Exercise: Stoplight State Machine Implementation

The objective of this exercise is to gain more experience developing a State Machine - based implementation of a Controller.

Assignment

Download this EA class diagram and partially-completed application, which simulates a 3-color (red, yellow, green) Stoplight.

First, using EA, add a State Machine to the Stoplight class and draw the UML State diagram for the Stoplight, which continually cycles from green to yellow to red (to green to yellow to red...). Be sure to create and illustrate the specific event and the actions resulting from each event.

Work with your instructor to ensure that the UML State Diagram you create is correctly formed. Save the resulting state diagram to a Stoplight.PDF file.

Next, create an Eclipse project named "Stoplight", and add the StoplightDisplay.java and Stoplight.java files to the project. Follow the "TODO" instructions in the Stoplight.java class to complete the implementation of the State Machine Controller. Note: You do not have to modify StoplightDisplay.java.

Submission (due by end of class)

Make sure you move or copy the Stoplight.PDF file to a "src" folder within your Eclipse project.

Zip the entire "src" directory (containing all of the .java files and .pdf files) into a file named Stoplight-solution.zip.

Make certain that the zip file is less than 1MB in size (or it will not be able to be emailed).

Email that file to your instructor, and verify that your instructor has received your email.