> > 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 place >> 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 services, >> 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_schema.t Test scripts for web access: http://dev.catalystframework.org/repos/Catalyst/trunk/examples/ExtJS/t/01app.t http://dev.catalystframework.org/repos/Catalyst/trunk/examples/ExtJS/t/controller_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
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
