> You mentioned Supervising Controller by Martin Fowler;
> did you know he has another variant of that same idea 
> called Presentation Model?
http://martinfowler.com/eaaDev/PresentationModel.html

Fowler describes four different patterns which he regards as different ways
of implementing the MVC or MVP patterns in his GUI architectures article
http://martinfowler.com/eaaDev/uiArchs.html and supporting articles
(Separated Presentation
http://martinfowler.com/eaaDev/SeparatedPresentation.html, Presentation
Model, Supervising Controller
http://martinfowler.com/eaaDev/SupervisingPresenter.html, and Passive view
http://martinfowler.com/eaaDev/PassiveScreen.html.

My interpretation is that he sees the Separated Presentation as being at the
heart of the MVC concept. He has retired the MVC pattern in his thinking
since he sees different forms of implementation. He sees this pattern as
separating the common functionality from the view specific functionality.

The Presentation Model he argues is the beginning of the shift from MVC to
MVP although he contends that the boundary is unclear. He says that the
presentation model is a class that contains "all the data of the UI window,
but without any of the controls used to render that UI on the screen." In
effect, it separates the view from the data needed to build the view. Fowler
talks about problems in synchronising the presentation model and the view.

The Passive View sees the manipulates the view as well as being a
presentation model. This approach sees the view having no built in
functionality and the controller or presenter manipulating the view to make
changes. The controller pushes data back into the view.

The Supervising Controller is similar to the passive view except that the
controller doesn't push data back into the view. This is left to data
binding mechanisms. The model in this pattern may be closer to a
presentation model rather than a domain model. The controller handles all
user gestures. One of the things with this pattern is that because the
controller and model have no knowledge of the view, it is easier to
implement in a test driven fashion.

I believe one of the points of difference between the patterns is the degree
of relationship between the view and the controller. In MVC, the controller
focused on handling user gestures and manipulating the model. The view was
left to look after itself. The presentation model was an attempt to
recognise that the view actually had model elements that could be used with
alternative views. The passive view proves difficult to test as you have to
mock out the view. The supervising controller removes all links back to the
view making it easier to build tests.

---------------------------------
Errol Thompson
Kiwi-ET Computing Education Research
Wellington, New Zealand
Phone: +64 21 210 1662
E-Mail: kiwiet (at) acm.org
        kiwiet (at) computer.org
Web: www.teach.thompsonz.net
---------------------------------

Reply via email to