[Catalyst] how to reuse Catalyst Schema for non-web purposes?

Peter Edwards peter at dragonstaff.com
Wed Apr 22 22:19:14 GMT 2009


2009/4/22 <kakimoto at tpg.com.au>

>   Good morning. I am interested in hearing more about this.
> IMO the best place for your business logic is the controller.
> A view is made out of the html (usually templated with a templating
> system such as template toolkit).

For example, in an application that sells insurance (doing away with any
> javascript which does any business logic):
>

Okay, imagine the situation where you wish to send out insurance renewal
reminders.
You want to run it from a batch program so you can merge it to PDF and email
/ print and snailmail all the customers. Obviously, there is no web screen
involved!
You wish to use the Catalyst DBIC business object Model to get at the data.
How are you going to do that if you need to use the web controller? Agreed,
you *could* run the web transactions and collect the data as, say, XML, but
that would be very inefficient.
That is why the recommendation is to make the Controller a very thin layer
and to put as much business logic as possible in the Model.
I wrote a (somewhat outdated) article for the Catalyst advent calendar a
couple of years ago on how to do this:
http://www.catalystframework.org/calendar/2007/14

Best wishes,
Peter
http://perl.dragonstaff.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090422/da56d=
ae0/attachment.htm


More information about the Catalyst mailing list