[Catalyst] Re: [RHTMLO] RFC: Catalyst::Controller::RHTMLO

Jason Gottshall jgottshall at capwiz.com
Mon Jan 26 18:43:36 GMT 2009

Peter Karman wrote:
> Jason Gottshall wrote on 1/22/09 4:52 PM:
>> [Cross-posted to catalyst-users and rhtmlo lists]
>> I know there are several modules out there that hook up rhtmlo and 
>> catalyst, but none of them do what I want. They all seem to do too much: 
>> connect to a CRUD API, interface with rdbo, build a form object from a 
>> config file, etc. I really just need a simple glue to load 
>> rhtmlo-derived form classes into my catalyst controller actions and 
>> initialize them with any query params, so I created a base controller 
>> and an action class that take care of the details. It works for me, but 
>> I thought it might be useful to the larger community, so I made it 
>> configurable and documented it pretty thoroughly. But before I pollute 
>> CPAN with one more piece of cruft, I want to be sure it's 
>> sensible/useful. The two packages are defined below. Comments would be 
>> appreciated.
> As the author of some of the modules that do too much, I like this idea. I
> especially like the use of the Action class.

Thanks. I can't take credit for the Action class stuff; I borrowed the 
idea and much of the technique from Catalyst::Controller::FormBuilder.

> I second John's suggestion of caching Form objects. I do that in
> CatalystX::CRUD::Controller::RHTMLO, and esp for forms that contain select lists
> (e.g. state or country names) it saves a huge overhead in form initialization.

Caching sounds wise. The only kink I see is that my controller allows 
for multiple instances of the same form. But I only added that support 
because I was trying to anticipate what would happen if someone actually 
tried it; I haven't yet run into that use case myself. I think I could 
still make it work, even with caching, but if not I think the value 
caching wins out over support for multiple instances of the same form.

I'll have a run at implementing caching before distributing it...

Jason Gottshall
jgottshall at capwiz.com

More information about the Catalyst mailing list