10
Introduction to Catalyst The Elegant Web Framework Dan Dascalescu (dandv)

Introduction To Catalyst - Part 1

Embed Size (px)

DESCRIPTION

Part 1 of "Introduction to Catalyst" talks about installing Catalyst, creating your first application, examining its structure, and how HTTP requests are dispatched.

Citation preview

Page 1: Introduction To Catalyst - Part 1

Introduction to Catalyst

The Elegant Web Framework

Dan Dascalescu (dandv)

Page 2: Introduction To Catalyst - Part 1

What is Catalyst?

• “the” Perl web application framework– Most actively developed (2005 – 2 wks ago)– Most widely used– Most flexible– Backward-compatible

Page 3: Introduction To Catalyst - Part 1
Page 4: Introduction To Catalyst - Part 1
Page 5: Introduction To Catalyst - Part 1
Page 6: Introduction To Catalyst - Part 1

Catalyst philosophy

• TIMTOWTDI crystallized, DRY, glue• Model-View-Controller• “Catalyst diet”: fat model, thin controller• Flexibility

– Models: DBIx::Class, KiokuDB, Net::LDAP, SVN etc.– Views: Template Toolkit, GraphViz,

HTML::Seamstress, Mason, XSLT, PHP (!) etc.– Forms: HTML::FormFu, Reaction, FormBuilder– Deployment: built-in server, FastCGI, mod_perl– 210 plugins on CPAN

Page 7: Introduction To Catalyst - Part 1

Production ready

• Support (built-in or plugins) for:– Any database (via Perl’s DBI)– Any model (Catalyst::Model::Adaptor)– Authentication: Flickr, HTTP, OpenID etc.– Authorization: ACL, Roles– Cache: FastMmap, FileCache, BerkeleyDB, and Memcached– CAPTCHA– Compression (Bzip2, Gzip etc.)– Crypto– RIA: Dojo, Prototype– Sessions– Static file serving– Unicode– RPC: JSONRPC, XMLRPC; Catalyst::Action::REST

Page 8: Introduction To Catalyst - Part 1

From Perl to Catalyst in 15 minutes

TinyURL app

See screencast at http://bit.ly/dandv-catalyst

eqhttp://wiki.dandascalescu.com/howtos/catalyst/introduction_to_catalyst

Page 9: Introduction To Catalyst - Part 1

Helpers

• Built-in helpers to create:– skeleton application: catalyst.pl MyApp– models:

• script\tinyurl_create.pl model DB DBIC::Schema TinyURL::Schema create=static "dbi:SQLite:tinyurl.db"

– AutoCRUD– views:

• script\tinyurl_create.pl view HTML TT

– controllers:• script/myapp_create.pl controller Name

Page 10: Introduction To Catalyst - Part 1

Resources

• Catalyst wiki (dogfood-powered by MojoMojo):– http://dev.catalystframework.org/wiki

• #catalyst on irc.perl.org• Catalyst mailing list

– http://snipurl.com/catalyst-mailing-list