[Catalyst] Begginer's question about application structure

Peter Edwards peter at dragonstaff.co.uk
Mon Nov 22 15:29:33 GMT 2010


>
> Martin Bendix wrote:
>
>> As a Perl and Catalyst novice, I have recently completed the online
>> Catalyst tutorial, and read the Definitive Guide to Catalyst.  However, I
>> have a few questions about the basic structure of a thin controller, fat
>> model application.
>>
>> I'd like to take my learning to the next stage by writing a fully
>> functioning application, and the classic CD database seems like a good p=
lace
>> to start - it will at least be of use to me when it's done.
>>
>> Given the following basic criteria, I would be grateful for some
>> high-level advice on how best to organise the application:
>>
>> * I will be using DBIx::Class to access the database.
>> * At first, the initial user interface will be web based.
>> * I'd like to structure the application so that I can add additional
>> interfaces with relative ease in future (e.g., command line, web service=
s,
>> etc.).
>> * I'd like to create test scripts for as many of the modules/application
>> functions as possible.
>> * The application will provide the ability to create, search, update and
>> delete artists, tracks, and CDs.
>>
>>
Have a look at this article
http://www.catalystframework.org/calendar/2007/14 which covers using
Catalyst models externally.
The code that goes with it is well out of date but should give you the
general idea using an external DBIC model class.

Access to the model from a batch script:
http://dev.catalystframework.org/repos/Catalyst/trunk/examples/ExtJS/script=
/dump_bookings.pl

Test script for model:
http://dev.catalystframework.org/repos/Catalyst/trunk/examples/ExtJS/t/10_s=
chema.t

Test scripts for web access:
http://dev.catalystframework.org/repos/Catalyst/trunk/examples/ExtJS/t/01ap=
p.t

http://dev.catalystframework.org/repos/Catalyst/trunk/examples/ExtJS/t/cont=
roller_ExtJS-Controller-ExtJS.t

Some more pointers on testing:
http://dragonstaff.blogspot.com/2009/05/testing-with-perl-catalyst.html


Cheers, Peter
http://perl.dragonstaff.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101122/06499=
f17/attachment.htm


More information about the Catalyst mailing list