The Headphone Story
This is an additional task if we have time left.
You work as a summer intern at a computer company during the spring of 2007. You get the task to develop a controller for a mysterious remote control for some headphone stuff or so. Everyone is busy. A product manager drops by, and tells you:
"The controller should translate button clicks into specific commands, depending on how often the user clicks. A single click should generate signal ’switch’. I think they use that for switching between playing and pausing. A double click should send signal ’next’. And if the user clicks three times in a row they need signal ’back’. That’s all I know. I have to go. Oh... the guys from the X-department gave me a diagram how it should be integrated. Here.”

You are confused, but manage to draw a sequence diagram onto the whiteboard. When the product manager comes again, you ask if it looks okay. The immediate answer is:
"Sure. Build it!"
And the product manager is away again. You shout:
"But wait.. there is one thing I need to know. How long... never mind."
But even without the answer, you create a state machine.
After you created the state machine, an engineer from team X drops by.
"Are you done with the design? I have bad news. We made some changes. We require not a single switch signal, but dedicated pause and play signals. Just assume that all music is paused when your controller is activated. You need to build it all again."

That's tough. But you manage to build another state machine that solves the task. That's the story.
Questions
- Draw the sequence diagram that you sketched on the whiteboard.
- Which information did you try to get from the product manager?
- Build the first state machine for the controller.
- What is the difference for the state machine of the controller because of the changes?
- Draw a second state machine that uses the signals
pause
andplay
instead ofswitch
. - Looking at the new state machine and comparing it with the first one, why do you feel confident it is the proper solution?