Navigation:  Programming Cookbook > Creating GUI Applications >


Previous pageReturn to chapter overviewNext page

Since a view and presenter may register an interest in particular events that they expect a model to generate, you cannot plug any view or presenter onto any model and expect them to work.

Normally, we classify the "type" of an object effectively by the message protocol that it responds to. For the sake of MVP we should, perhaps, extend our notion of "type" to include not only the message protocol but also the "protocol of events" that can be triggered by an object. It is important in MVP to only plug a particular view or presenter onto a certain type of model.

For example, the ListBox and ListPresenter classes expect a model with a message protocol and an event protocol exemplified by the ListModel class.