Re: [Maypole] Multiple controllers

From: Vsevolod (Simon) Ilyushchenko (simonf at cshl.edu)
Date: Wed Jan 12 2005 - 22:14:12 GMT


> I'm not sure I've understood your question, so forgive me if I go off at
> a tangent.

No, you are right on target.
> For dates in particular, and also as an example of the general case,
> Maypole relies on the model's facilities (i.e. CDBI). You would pick a
> suitable class to model a date (Time::Piece is the usual example) and
> tell CDBI and friends to use it by calling has_a (see the Class::DBI
> docs) and untaint_columns (see Class::DBI::FromCGI and CGI::Untaint).

I also have various date-checking and -formatting functionality which
has to be encapsulated in a class. Plus the same thing happens with a
more complex EmployeeChecker.

> Maypole has the concept of component requests (i.e. bits of pages with
> different models etc) on output but AFAIK it doesn't have a standard way
> to do that on input. But you could easily code the top-level responding
> action to call component actions to deal with parts of the input. The
> interface would be by side-effect - changed state in the model - unless
> you wanted to code specific features into the method calls. But this
> sounds OK; going back to the object in the model that represents your
> date and asking it for its value seems like the right thing to do.

I was just wondering if anyone has created some kind of formal pattern
to deal with this. On a page that has several controllers, this can get
messy - you have to send data from the model (and maybe from the web) to
the controller, invoke the error checking function and then transfer
possibly modified data back to the model.

Thanks,
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