Re: Design help needed (model view controller)
- From: Robert Martin <unclebob@xxxxxxxxxxxxxxxx>
- Date: Sun, 28 May 2006 12:16:29 -0500
On 2006-05-27 22:12:56 -0500, "Daniel T." <postmaster@xxxxxxxxxxx> said:
In article <1148767964.671165.79540@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"BrianS" <Finster_Baby101@xxxxxxxxxxx> wrote:
Thanks for the replies. Does anyone know where I can find a simple
example of MVC correctly coded in C++? (The full code not just bits
and pieces) I found a lot of Java, C# stuff but not C++.
Once again, thanks in advance.
Unfortunately no. MVC is quite old and most OSs chose to go with a higher level architecture that basically implemented both the View and Controller. Hence the rise of MVP where "V" represents the OS (both input and output) as a unit.
I think you mean Document-View, which munges the View and Controller together into an evil hybrid and eliminates the best of the partitioning of MVC.
Model View Presenter, on the other hand does not eliminate the controller, nor munge it into the View. In a good MVP design there are four objects, a Model, a View, a Controller, and a Presenter. The Presenter is really just a partitioning of the classical View into two parts. The presenter part knows how to organize the data into presentation format. It knows that there will be lists, menus, buttons, checkboxes, etc; but does not know about the GUI elements that represent those entities. The View simply binds the presenter data to the GUI elements. Thus the View is nothing but wiring and makes no significant decisions at all. The Presenter takes over the burden of knowing the state of the presentation (whether buttons should be grey or not) etc.
The Controller still exists, and is still responsible for gathering user input and interpreting it into commands that manipulate the model.
--
Robert C. Martin (Uncle Bob) | email: unclebob@xxxxxxxxxxxxxxxx
Object Mentor Inc. | blog: www.butunclebob.com
The Agile Transition Experts | web: www.objectmentor.com
800-338-6716 |
.
- References:
- Design help needed (model view controller)
- From: BrianS
- Re: Design help needed (model view controller)
- From: Alec Ross
- Re: Design help needed (model view controller)
- From: BrianS
- Re: Design help needed (model view controller)
- From: Daniel T.
- Design help needed (model view controller)
- Prev by Date: Re: Facade
- Next by Date: Re: Mixins, Multiple Inheritance, Interfaces
- Previous by thread: Re: Design help needed (model view controller)
- Next by thread: Re: Design help needed (model view controller)
- Index(es):