[Catalyst] how to reuse Catalyst Schema for non-web purposes?
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
Okay, imagine the situation where you wish to send out insurance renewal
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
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:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Catalyst