> -----Ursprüngliche Nachricht-----
> Von: "Rodrigo" <rodrigol...@gmail.com>
> Gesendet: 27.03.09 17:10:47
> An: The elegant MVC web framework <catalyst@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


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to