[Catalyst] General Web- and OO-question

Andreas Mock Andreas.Mock at web.de
Fri Mar 27 17:10:51 GMT 2009


> -----Ursprüngliche Nachricht-----
> Von: "Rodrigo" <rodrigolive at gmail.com>
> Gesendet: 27.03.09 17:10:47
> An: The elegant MVC web framework <catalyst at lists.scsys.co.uk>
> Betreff: Re: [Catalyst] General Web- and OO-question

Hi Rodrigo,

thank you for answering.

> I wouldn't. Just instantiate your object at the entry controller and 
> store the instance in the $c->session, or wherever you find 
> appropiate depending on the object characteristics and the kind of 
> state handling you need. 

But that' s my problem: One one web page I do not get all attributes I need
to instantiate the object correctly. Simple unrealistic example. One one page
the user can enter a "name" on the second the "age". The object can be instatiated
if you provide a valid name and age.

After the first page I do have the name, but not the age yet. But I can't instatiate
the object because it throws an exception because age is not valid, isn't it?
Or does Moose check constraints only on provided attributes. This can't be true
with "required" attributes, can it?

> 
> Do your entry validation as part of the attribute checking validation,
> as in Moose:

I would like it to do so...

> What ways are you going? Which is the "right" OO-way of doing it?
> 
> TIMTOWTDI

I start to hate this perl slogan...  ;-)
I want a "good" way.

> Catalyst::Model::Adaptor may also come in handy if 
> you feel you need to turn your class into a model.

What do you mean with that?

Best regards
Andreas




More information about the Catalyst mailing list