Book Image

Catalyst

By : Jonathan Rockway
Book Image

Catalyst

By: Jonathan Rockway

Overview of this book

<p>Many web applications are implemented in a way that makes developing them painful and repetitive. Catalyst is an open-source Perl-based Model-View-Controller framework that aims to solve this problem by reorganizing your web application to design and implement it in a natural, maintainable, and testable manner, making web development fun, fast, and rewarding.<br /><br />Everything that your web application needs to do is only written once; you connect to the database in one place, have configuration in one place, etc. Then, you just write actions for each URL that your application needs, without worrying about the database connections or HTML to produce. Catalyst will handle the details so you can worry about writing your application.<br /><br />Catalyst is designed to be reliable. There are hundreds of production applications and thousands of users. The code is well-tested, and new releases almost always maintain compatibility with applications written for older versions. You don't have to worry about Catalyst breaking your application and slowing down your development. It just works.<br /><br />Most importantly, Catalyst has a thriving community. You can ask a question on the IRC channel and get a response at almost any time of the day.<br />&nbsp;<br />This book embodies Catalyst's philosophies of Do It Yourself and Don't Repeat Yourself.</p>
Table of Contents (14 chapters)

MyApp Directory Structure


Before we start modifying MyApp, let's take a look at how a Catalyst application is structured on a disk. In the root directory of your application, there are some support files. If you're familiar with CPAN modules, you'll be at home with Catalyst. A Catalyst application is structured in exactly the same way (and can be uploaded to the CPAN unmodified, if desired).

Note

This chapter will refer to MyApp as your application's name, so if you use something else, be sure to substitute appropriately.

Files in the MyApp Directory

Makefile.PL: This is a script that will generate a makefile to build, test and install your application. It can also contain a list of your application's CPAN dependencies and automatically install them. To run Makefile.PL and generate a Makefile, simply type perl Makefile.PL. After that, you can run make to build the app, make test to test the app (you can try this right now, as some sample tests have already been created), make install to...