[Catalyst] Unit Testing

Octavian Rasnita orasnita at gmail.com
Sun Apr 20 08:38:46 BST 2008


From: "Dave Rolsky" <autarch at urth.org>
> On Sat, 19 Apr 2008, John Romkey wrote:
>
>> I suspect that most Catalyst users build their applications so that the 
>> controllers do too much work. I certainly did, and I'm gradually 
>> rewriting mine to move most of the work into the model. Where before my 
>> controllers
>
> A good way to approach a webapp is to think of the Controller as a thin 
> shim between the the web/HTTP environment and your model.
> Of course, the ultimate benefit is that it's the only sane way to write an 
> application ;)

I heard this for more times, but I am usually creating my controllers using 
a helper tool like:

perl scripts/myapp_create.pl model MyData DBIC::Schema MyData create=static 
dbi:mysql:database=mydata user pass

Is this tool not recommended? Or should it be used only as a tool for 
starting creating the model and the DBIC classes?

Please tell us if we can find an example of putting the logic in the model 
than call those methods from the controller.

Thanks.

Octavian








More information about the Catalyst mailing list