Upload
crystal-woods
View
218
Download
0
Embed Size (px)
Citation preview
Traffic Light: A Pedagogical Exploration Through a Design Space
Viera K. Proulx [email protected]
Jeff Raab [email protected]
Richard Rasala [email protected] University, Boston MA 02115
http://www.ccs.neu.edu/teaching/EdGroup/
NSF LLD award DUE-9659552 + Microsoft support
Outline
• Our Mantra: Examples that Matter
• Model- View-Controller
• Model: State and Transitions
• Display and Control
• Adding Variations
• Pedagogical Considerations
• Conclusion
Our Mantra: Examples that Matter
• OO is a new paradigm
• Need objects with rich behavior
• Need problems with interacting objects
• Need to escape from sequential model
• Accessible examples
• Graphics - motivation, feedback
• Design exploration
Model - View - Controller
• Design pattern used with displays
• Model: internal data we need to keep
• Model: actions on internal data
• View: display of information for user
• View: used both for input and output
• Controller: responds to user actions
• Controller: initiates model actions
Model: State and Transitions
• Traffic light: to the outside observer– exhibits the current display – changes to a new display based on a timer– cycles through a set of possible displays
• Internal model– state of the lights at the whole intersection– length of time for each state to last– sequence of states that we cycle through
Display and Control
• Display and Control Elements:– display: four light faces (NESW)– control: Start, Stop, Step - cycle– display: state settings for one timer interval
plus length of time– display: whole control sequence – control: place in control sequence– control: append, change, delete, clear
Adding Variations
• Left turn lights• Flashing lights• Four-way walk lights• Unidirectional walk lights• Walk request button• Emergency sequence• Multiple time-of-day sequences• Sensor-driven light changes
Pedagogical Considerations
• Students are familiar with real life problem• Basic model ideal for object oriented
solution• Model-View-Controller model is right• Number of options for implementation of the
data model representation• Number of choices for controls and displays
Pedagogical Considerations
• Simplest project: Design a basic light– design and implement state transition diagrams– design the data model– design the display– design the controls– implement your design
• Expand: discuss design of options• Implement some of them
Conclusion
• Our experiences:– interesting project - students get involved– some do not understand what to include in the
light class - good opportunity to learn– good students can push the boundary
• Conclusion– more examples like this are needed– they change the way we ALL think about
programming