OT: Templating systems (was RE: [Catalyst] New default screen for Catalyst)

Sam Vilain sam at vilain.net
Tue Oct 25 06:33:42 CEST 2005


On Fri, 2005-10-21 at 08:25 -0400, John Siracusa wrote:
> As I replied to Bill off-list, I don't pass hashes or arrays of data to
> views, nor do I pass db objects.  I pass a form object, which is already
> populated with all the info I need.  (Rarely will the view also need the
> associated db object, but if it does I can pass that too.)  So I'm firmly in
> the "get the data up front" camp :)
> 
> The flow is like this:
> 
>     1. Instantiate and load the db object.
>     2. Initialize the form object with the db object.
>     3. Pass the form object to the view
>        (and maybe the db object too, but usually not.)
>     4. The view asks the form object to render its fields
>        (or pieces of fields, or passes the fields or form object
>        onto other sub-views, etc. etc.)

And avoiding all that mucking about is precisely why you'd want to use
an orthogonal storage system that doesn't intrude to your classes, and
supports demand loading.

Sam.




More information about the Catalyst mailing list