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

kakimoto at tpg.com.au kakimoto at tpg.com.au
Thu Apr 23 02:42:26 GMT 2009


Hello, Peter,

 I had a look at your ExtJs app via the url given in this email.

 Basically, the script just makes direct calls to the Model. Business
logic is found in the script itself and not the Model .

 Unfortunately, I still can't see the importance of business logic being
placed in the Model than the Controller.

 Nevertheless, simon Wilcox's opinion in one of the emails in this
thread does bring some good weight for thought.

thank you.

k. akimoto



Quoting Peter Edwards <peter at dragonstaff.com>:

> 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
> 






More information about the Catalyst mailing list