[Maypole] Multiple controllers
Dave Howorth
dhoworth@mrc-lmb.cam.ac.uk
Thu, 13 Jan 2005 15:20:54 +0000
Perrin Harkins wrote:
> Vsevolod (Simon) Ilyushchenko wrote:
>> 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.
>
> It sounds like what you are currently doing is more along the lines of
> the compromise I mentioned -- using something like Data::FormValidator
> in the controller, even though it kind of breaks MVC, because it's so
> much easier. I do this too, but would like to have better separation.
I'm interested in this area and haven't ever seen any complete
solutions. Data::FormValidator looks interesting but I haven't had time
to try it yet. Simon, is there any chance of you posting [some of] your
code so we can get a better idea of the advantages and drawbacks that
you have found?
I don't hold MVC as an ideal, so I'm not too worried about breaking it.
I do have a soft spot for Martin Fowler's facades.
Cheers, Dave