
* Manfred Doudar <manfred.doudar@metoceanengineers.com> [2004-12-23 10:03]:
Alan Gutierrez wrote:
* Dave Harris <brangdon@cix.compulink.co.uk> [2004-12-23 07:14]:
In-Reply-To: <20041222211651.GD2616@maribor.izzy.net> alan-boost@engrm.com (Alan Gutierrez) wrote (abridged):
I'd like to take some time and study what has gone before. [...] I've advocated the use of a CSS layout component to render the View-Controller aspect [...]
Are you aware of the variations on MVC, in particular Model-View-Presenter? MVP has been so successful in Smalltalk that I consider MVC obsolete. Taligent's whitepaper is here:
This is password protected. Somewhere else perhaps?
You can get this document here:
http://web.archive.org/web/20010827084558/www-106.ibm.com/developerworks/lib...
Note however, the only difference between this and the original is that they've simply replaced most occurances of "C++" with the word "Java" - now that's heretical revisionism if ever I saw it !
Synopsis: Start with a description of Model-View-Controler. Model Questions: Model, Selections, Commands. What is my data? What can I do to my data? How dow I select my data? View Questions: View, Interactor, Presenter. How do I display my data? How events map into changes in my data? How do I put it all together? A model is say, check register. A selection is say, the category field of a specific check. A command is would be to the the category to "Utilties". A view is say, a row in a table display of the check register. A interactor is a drop down control in that checks row. What is the presenter? It seems that the command is used so (and I'm just learning C++): class mvp::command { public: command(mvp::selection & selected): selected(selected) { } command(mvp::command & command): selected(selected.command) { } void do_it(mvp:model & model); void undo_it(mvp::model & model); private: mvp::selection& selected; }; It seems like the interactor could be a generic that constructs the correct command, so the presenter is that a factory for a Java implementation. template <class Command> class mvp::interactor { public: Command on_select_change(std::string & string); }; -- Alan Gutierrez - alan@engrm.com