Imagine an audio player that does 3 main things:
Data manipulation and creation should be handled by the model.
The view would be the actual GUI, with all the controls such as play/pause/volume etc. Each control would have events associated with it, such as play_click, pause_click, volume_up etc.
The presenter would have event handlers for these view events. Whenever an event occurs, the associated handler would execute, causing changes in the model and/or view as required.
For example, if the model contains a
volume property, and the view raises a
volume_up event, the
onVolume_up event handler in the presenter will execute, causing the
volume property of the model to increment, and also update the view accordingly.
Note that the presenter does not depend on the view. So tomorrow you can change your entire GUI, and you wouldn't have to touch the presenter or the model.
You can set up all of this manually yourself, or use a framework like Knockoutjs.