.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Catalyst::Manual::About 3pm" .TH Catalyst::Manual::About 3pm "2013-05-06" "perl v5.18.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Catalyst::Manual::About \- The philosophy of Catalyst .SH "DESCRIPTION" .IX Header "DESCRIPTION" This document is a basic introduction to the \fIwhy\fR of Catalyst. It does not teach you how to write Catalyst applications; for an introduction to that please see Catalyst::Manual::Intro. Rather, it explains the basics of what Catalyst is typically used for, and why you might want to use Catalyst to build your applications. .SS "What is Catalyst? The short summary" .IX Subsection "What is Catalyst? The short summary" Catalyst is a web application framework. This means that you use it to help build applications that run on the web, or that run using protocols used for the web. Catalyst is designed to make it easy to manage the various tasks you need to do to run an application on the web, either by doing them itself, or by letting you \*(L"plug in\*(R" existing Perl modules that do what you need. There are a number of things you typically do with a web application. For example: .IP "\(bu" 4 Interact with a web server .Sp If you're on the web, you're relying on a web server, a program that sends files over the web. There are a number of these, and your application has to do the right thing to make sure that your program works with the web server you're using. If you change your web server, you don't want to have to rewrite your entire application to work with the new one. .IP "\(bu" 4 Do something based on a \s-1URI\s0 .Sp It's typical for web applications to use URIs as a main way for users to interact with the rest of the application; various elements of the \s-1URI\s0 will indicate what the application needs to do. Thus, \&\f(CW\*(C`http://www.mysite.com/add_record.cgi?name=John&title=President\*(C'\fR will add a person named \*(L"John\*(R" whose title is \*(L"President\*(R" to your database, and \f(CW\*(C`http://www.mysite.com/catalog/display/23\*(C'\fR will go to a \*(L"display\*(R" of item 23 in your catalog, and \&\f(CW\*(C`http://www.mysite.com/order_status/7582\*(C'\fR will display the status of order 7582, and \f(CW\*(C`http://www.mysite.com/add_comment/?page=8\*(C'\fR will display a form to add a comment to page 8. Your application needs to have a regular way of processing these URIs so it knows what to do when such a request comes in. .IP "\(bu" 4 Interact with a data store .Sp You probably use a database to keep track of your information. Your application needs to interact with your database, so you can create, edit, and retrieve your data. .IP "\(bu" 4 Handle forms .Sp When a user submits a form, you receive it, process it to make sure it's been filled in properly, and then do something based on the result\*(--submit an order, update a record, send e\-mail, or return to the form if there's an error. .IP "\(bu" 4 Display results .Sp If you have an application running on the web, people need to see things. You usually want your application displayed on a web browser, in which case you will probably be using a template system to help generate \&\s-1HTML\s0 code. But you might need other kinds of display, such as \s-1PDF\s0 files, or other forms of output, such as \s-1RSS\s0 feeds or e\-mail. .IP "\(bu" 4 Manage users .Sp You might need the concept of a \*(L"user\*(R", someone who's allowed to use your system, and is allowed to do certain things only. Perhaps normal users can only view or modify their own information; administrative users can view or modify anything; normal users can only order items for their own account; normal users can view things but not modify them; order-processing users can send records to a different part of the system; and so forth. You need a way of ensuring that people are who they say they are, and that people only do the things they're allowed to do. .IP "\(bu" 4 Develop the application itself .Sp When you're writing or modifying the application, you want to have access to detailed logs of what it is doing. You want to be able to write tests to ensure that it does what it's supposed to, and that new changes don't break the existing code. .PP Catalyst makes it easy to do all of these tasks, and many more. It is extremely flexible in terms of what it allows you to do, and very fast. It has a large number of \*(L"components\*(R" and \*(L"plugins\*(R" that interact with existing Perl modules so that you can easily use them from within your application. .IP "\(bu" 4 Interact with a web server? .Sp Catalyst lets you use a number of different ones, and even comes with a built-in server for testing or local deployment. .IP "\(bu" 4 Do something based on a \s-1URI\s0? .Sp Catalyst has extremely flexible systems for figuring out what to do based on a \s-1URI.\s0 .IP "\(bu" 4 Interact with a data store? .Sp Catalyst has many plugins for different databases and database frameworks, and for other non-database storage systems. .IP "\(bu" 4 Handle forms? .Sp Catalyst has plugins available for several form creation and validation systems that make it easy for the programmer to manage. .IP "\(bu" 4 Display results? .Sp Catalyst has plugins available for a number of template modules and other output packages. .IP "\(bu" 4 Manage users? .Sp Catalyst has plugins that handle sessions, authentication, and authorization, in any way you need. .IP "\(bu" 4 Developing the application? .Sp Catalyst has detailed logging built-in, which you can configure as necessary, and supports the easy creation of new tests\*(--some of which are automatically created when you begin writing a new application. .PP \fIWhat \f(BIisn't\fI Catalyst?\fR .IX Subsection "What isn't Catalyst?" .PP Catalyst is not an out-of-the-box solution that allows you to set up a complete working e\-commerce application in ten minutes. (There are, however, several systems built on top of Catalyst that can get you very close to a working app.) .PP Catalyst is designed for flexibility and power; to an extent, this comes at the expense of simplicity. Programmers have many options for almost everything they need to do, which means that any given need can be done in many ways, and finding the one that's right for you, and learning the right way to do it, can take time. \s-1TIMTOWDI\s0 works both ways. .PP Catalyst is not designed for end users, but for working programmers. .SS "Web programming: The Olden Days" .IX Subsection "Web programming: The Olden Days" Perl has long been favored for web applications. There are a wide variety of ways to use Perl on the web, and things have changed over time. It's possible to handle everything with very raw Perl code: .PP .Vb 2 \& print "Content\-type: text/html\en\en