<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
But that' s my problem: One one web page I do not get all attributes I need<br>
to instantiate the object correctly. Simple unrealistic example. One one page<br>
the user can enter a "name" on the second the "age". The object can be instatiated<br>
if you provide a valid name and age.</blockquote><div><br>Well, just instantiate an empty object then use the accessors Moose creates for you automagically. Accessors validate as well:<br><br>sub start_up : Local {<br>
$c->session->{obj} = new MyClass();<br>
}<br>sub submit_name : Local {<br> $c->session->{obj}->name( $c->req->params->{name} );<br>}<br>sub submit_age : Local {<br>
$c->session->{obj}->age( $c->req->params->{age} );<br>
}<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">But I can't instatiate<br>
the object because it throws an exception because age is not valid, isn't it?</blockquote><div> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Or does Moose check constraints only on provided attributes. This can't be true<br>
with "required" attributes, can it?<br>
<div class="im"></div></blockquote><div><br>As long as the attribute is not "required => 1", no exception is thrown. <br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
> Catalyst::Model::Adaptor may also come in handy if<br>
> you feel you need to turn your class into a model.<br>
<br>
</div>What do you mean with that?<br>
<div><div></div><div class="h5"></div></div></blockquote><br>First, read up on the Model part of MVC, that's where most of your application storage should end up. Have you decided what are you going to do with the object once it's filled up? <br>
</div><br>--rodrigo<br>