[Catalyst] Form validation in insert() and update()?

mla maurice.aubrey at gmail.com
Thu May 17 22:36:54 GMT 2007


Matt S Trout wrote:
> On Wed, May 16, 2007 at 06:46:57PM -0700, mla wrote:
>> I'm thinking Catalyst::Model should provide some sort of interface for
>> this.
> 
> This doesn't belong at the Catalyst core level since Catalyst is expressly
> -not- opinionated about how your model is written.
> 
>> If there was a consistent interface to the model that provided those
>> functions then a lot of the standard data validation and CRUD stuff
>> becomes dead single.
> 
> Which we've done with great success with Reaction and the
> Reaction::InterfaceModel system.
>  
>> Any generic model that wanted to be pluggable into Catalyst could
>> provide that "attribute" interface (other models would still work,
>> just not with anything that assumed the attribute interface was
>> present), either directly or as a wrapper class.
> 
> What myself and the other Reaction hackers are working towards is
> 
> (a) a generalised collection interface
> (b) a reflection system that's powerful enough to provide typed mutations
> (c) an abstract representation of transactional mutations
> 
> But it's a -bloody- hard job, and getting the design right is proving an
> exercise in repeated iteration.
> 
> What I'm hoping is we can get it all figured out in Reaction and then
> abstract out what works into some sort of standard API - which I don't
> think will need to depend on anything at all except for the Moose metaprotocol
> interface (which would handle the 'attribute interface' part of what you're
> describing). Once we have that, a Catalyst::Model::${whatever_we_call_it} can
> be written to tie any collection of classes that implements this API into
> a Catalyst app.

Yes, that sounds good. I see there's nothing on CPAN yet. Where can
I find more on Reaction?

Maurice



More information about the Catalyst mailing list