11
Traffic Light: A Pedagogical Exploration Through a Design Space Viera K. Proulx [email protected] Jeff Raab [email protected] Richard Rasala [email protected] Northeastern University, Boston MA 02115 http://www.ccs.neu.edu/teaching/EdGroup/

Traffic Light: A Pedagogical Exploration Through a Design Space Viera K. [email protected] Jeff [email protected] Richard Rasala [email protected]

Embed Size (px)

Citation preview

Page 1: Traffic Light: A Pedagogical Exploration Through a Design Space Viera K. Proulxvkp@ccs.neu.edu Jeff Raabjmr@ccs.neu.edu Richard Rasala rasala@ccs.neu.edu

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

Page 2: Traffic Light: A Pedagogical Exploration Through a Design Space Viera K. Proulxvkp@ccs.neu.edu Jeff Raabjmr@ccs.neu.edu Richard Rasala rasala@ccs.neu.edu

Outline

• Our Mantra: Examples that Matter

• Model- View-Controller

• Model: State and Transitions

• Display and Control

• Adding Variations

• Pedagogical Considerations

• Conclusion

Page 3: Traffic Light: A Pedagogical Exploration Through a Design Space Viera K. Proulxvkp@ccs.neu.edu Jeff Raabjmr@ccs.neu.edu Richard Rasala rasala@ccs.neu.edu

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

Page 4: Traffic Light: A Pedagogical Exploration Through a Design Space Viera K. Proulxvkp@ccs.neu.edu Jeff Raabjmr@ccs.neu.edu Richard Rasala rasala@ccs.neu.edu

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

Page 5: Traffic Light: A Pedagogical Exploration Through a Design Space Viera K. Proulxvkp@ccs.neu.edu Jeff Raabjmr@ccs.neu.edu Richard Rasala rasala@ccs.neu.edu

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

Page 6: Traffic Light: A Pedagogical Exploration Through a Design Space Viera K. Proulxvkp@ccs.neu.edu Jeff Raabjmr@ccs.neu.edu Richard Rasala rasala@ccs.neu.edu

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

Page 7: Traffic Light: A Pedagogical Exploration Through a Design Space Viera K. Proulxvkp@ccs.neu.edu Jeff Raabjmr@ccs.neu.edu Richard Rasala rasala@ccs.neu.edu

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

Page 8: Traffic Light: A Pedagogical Exploration Through a Design Space Viera K. Proulxvkp@ccs.neu.edu Jeff Raabjmr@ccs.neu.edu Richard Rasala rasala@ccs.neu.edu

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

Page 9: Traffic Light: A Pedagogical Exploration Through a Design Space Viera K. Proulxvkp@ccs.neu.edu Jeff Raabjmr@ccs.neu.edu Richard Rasala rasala@ccs.neu.edu

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

Page 10: Traffic Light: A Pedagogical Exploration Through a Design Space Viera K. Proulxvkp@ccs.neu.edu Jeff Raabjmr@ccs.neu.edu Richard Rasala rasala@ccs.neu.edu

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

Page 11: Traffic Light: A Pedagogical Exploration Through a Design Space Viera K. Proulxvkp@ccs.neu.edu Jeff Raabjmr@ccs.neu.edu Richard Rasala rasala@ccs.neu.edu