Re: [Maypole] Multiple controllers

From: Vsevolod (Simon) Ilyushchenko (simonf at cshl.edu)
Date: Thu Jan 13 2005 - 14:23:37 GMT


> I wasn't suggesting that you would just pass the entire world to your
> model objects. I meant that a controller would read the input and pass
> the appropriate parameters to a model object. The model has no idea
> that there's a web form involved.

Right.

> I'm talking about doing validation in the model objects here, so your
> controller would have to call a validation method on the model objects
> rather than implement its own.

Right, but since my controllers hold references to, say, date checkers,
they first call errorCheck() on the date checkers and then on the model.

> I'm not following this. Why would it be hard to share code between
> model objects in different applications? You can use the same
> techniques you would use for any other kind of code-sharing.

I may choose to show date as one text field, or as three numerical
fields. Depending on this, I will initialize my date checker objects
differently to use different validation rules. So the object
initializing the date checkers should know something about the
presentation, and I decided to let controllers rather then models to
initialize (and store) the checkers.

Simon

-- 

Simon (Vsevolod ILyushchenko) simonf at cshl.edu http://www.simonf.com

Terrorism is a tactic and so to declare war on terrorism is equivalent to Roosevelt's declaring war on blitzkrieg.

Zbigniew Brzezinski, U.S. national security advisor, 1977-81

_______________________________________________ maypole mailing list maypole at lists.netthink.co.uk http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT