Catalyst MVC Framework
   HOME

TheInfoList



OR:

Catalyst is an
open-source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
web application framework A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and ...
written in
Perl Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language". Perl was developed ...
. It closely follows the
model–view–controller Model–view–controller (MVC) is a software architectural pattern commonly used for developing user interfaces that divides the related program logic into three interconnected elements. These elements are: * the model, the internal representat ...
(MVC) architecture and supports a number of experimental web patterns. It is written using
Moose The moose (: 'moose'; used in North America) or elk (: 'elk' or 'elks'; used in Eurasia) (''Alces alces'') is the world's tallest, largest and heaviest extant species of deer and the only species in the genus ''Alces''. It is also the tal ...
, a modern object system for Perl. Its design is heavily inspired by frameworks such as
Ruby on Rails Ruby on Rails (simplified as Rails) is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web pa ...
,
Maypole A maypole is a tall wooden pole erected as a part of various European List of folk festivals, folk festivals, around which a maypole dance often takes place. The festivals may occur on May Day, 1 May or Pentecost (Whitsun), although in some co ...
, and Spring. Catalyst can be used by web application developers to deal with code common to all web applications. It provides an interface for receiving page requests, dispatching page requests into developer-written code to process, and return of the requests. Catalyst also provides a standardised interface for data models, authentication, session management and other common web application elements. All of these elements are implemented as plugins to a set of common interfaces, allowing the developer to change the specific method used (e.g. a session storing in shared memory versus as a database table, or using
FastCGI FastCGI is a binary protocol for interfacing interactive programs with a web server. It is a variation on the earlier Common Gateway Interface (CGI). FastCGI's main aim is to reduce the overhead related to interfacing between web server and CGI pr ...
versus operating as an within Apache's mod_perl) by changing the configuration of Catalyst to use a different plugin without altering the application code. Catalyst is primarily distributed through the
CPAN The Comprehensive Perl Archive Network (CPAN) is a software repository of over 220,000 software modules and accompanying documentation for 45,500 distributions, written in the Perl programming language by over 14,500 contributors. ''CPAN'' can de ...
, which is the official distribution channel for Perl libraries and applications.


History

Maypole was one of the first web application frameworks for the Perl programming language that was based on the MVC pattern; its principal author was Simon Cozens. Catalyst started as a
fork In cutlery or kitchenware, a fork (from 'pitchfork') is a utensil, now usually made of metal, whose long handle terminates in a head that branches into several narrow and often slightly curved tines with which one can spear foods either to h ...
of Maypole, intended to become Maypole 3.0. Development ceased on Maypole, however, with its most recent release in April 2008, and Catalyst became its modern supported equivalent. The first development release of Catalyst took place on 28 January 2005. The first official version was published on CPAN on 16 February 2005. As of June 2011, Catalyst had 201 registered contributors.


Philosophy

Catalyst is based on the "
don't repeat yourself "Don't repeat yourself" (DRY) is a principle of software development aimed at reducing repetition of information which is likely to change, replacing it with abstractions that are less likely to change, or using data normalization which avoids r ...
" (DRY) principle, which means that definitions should only have to be made once. Catalyst can be used with automatic class loading from the database through one of the many loader modules, thus requiring no code for the database layer. But, if you require the flexibility of manually doing everything, it's also an option. Another guiding principle of Catalyst is flexibility. Catalyst promotes the re-use of existing Perl modules that already handle common web application concerns well. * The ''Model'' part is handled through '' DBIx::Class'', ''Plucene'', ''Net::LDAP'' and other model classes. * The ''View'' layer is usually handled by '' Template Toolkit'', ''Mason'', or ''HTML::Template'', among others. * The ''Controller'' layer is of course written by each application author. Large chunks of Controller functionality can usually be deferred to one of the many Catalyst plugins (e.g., Catalyst::Plugin::FormValidator, Catalyst::Plugin::Prototype, Catalyst::Plugin::Account::AutoDiscovery, etc.). * Finally, Catalyst offers a set of helpers to simplify flow control and mapping URLs to controller methods. Catalyst has a large selection of plugins. For example, it has JavaScript generation for
Ajax Ajax may refer to: Greek mythology and tragedy * Ajax the Great, a Greek mythological hero, son of King Telamon and Periboea * Ajax the Lesser, a Greek mythological hero, son of Oileus, the king of Locris * Ajax (play), ''Ajax'' (play), by the an ...
and RIAs using the Catalyst::Plugin::Prototype module (
prototype A prototype is an early sample, model, or release of a product built to test a concept or process. It is a term used in a variety of contexts, including semantics, design, electronics, and Software prototyping, software programming. A prototype ...
is an
Ajax framework Ajax (also AJAX ; short for "asynchronous I/O, asynchronous JavaScript and XML") is a set of web development techniques that uses various web technologies on the client-side to create asynchronous web applications. With Ajax, web applications c ...
). Plugins cover many areas, for example authentication, session management, HTTP negotiation and REST. Catalyst can also be used with other Ajax frameworks such as jQuery or YUI, the
Yahoo! Yahoo (, styled yahoo''!'' in its logo) is an American web portal that provides the search engine Yahoo Search and related services including My Yahoo, Yahoo Mail, Yahoo News, Yahoo Finance, Yahoo Sports, y!entertainment, yahoo!life, and its a ...
User Interface Library.


Web server support

For development and testing, Catalyst has a built-in simple HTTP server. For production use,
Apache The Apache ( ) are several Southern Athabaskan language-speaking peoples of the Southwestern United States, Southwest, the Southern Plains and Northern Mexico. They are linguistically related to the Navajo. They migrated from the Athabascan ho ...
,
lighttpd lighttpd (prescribed pronunciation: "lighty") is an open-source web server optimized for speed-critical environments while remaining standards-compliant, secure and flexible. It was originally written by Jan Kneschke as a proof-of-concept of the ...
,
Hiawatha Hiawatha ( , also : ), also known as Ayenwatha or Aiionwatha, was a precolonial Native American leader and cofounder of the Iroquois Confederacy. He was a leader of the Onondaga people, the Mohawk people, or both. According to some accounts, he ...
,
Cherokee The Cherokee (; , or ) people are one of the Indigenous peoples of the Southeastern Woodlands of the United States. Prior to the 18th century, they were concentrated in their homelands, in towns along river valleys of what is now southwestern ...
or
Nginx (pronounced "engine x" , stylized as NGINX or nginx) is a web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. The software was created by Russian developer Igor Sysoev and publicly released in 20 ...
with
FastCGI FastCGI is a binary protocol for interfacing interactive programs with a web server. It is a variation on the earlier Common Gateway Interface (CGI). FastCGI's main aim is to reduce the overhead related to interfacing between web server and CGI pr ...
or
mod_perl mod_perl is an optional module for the Apache HTTP server. It embeds a Perl Interpreter (computing), interpreter into the Apache server. In addition to allowing Apache modules to be written in the Perl programming language, it allows the Apache ...
support is recommended, but any web server with CGI or FastCGI support will work. On Apache, mod_perl can help with performance considerably, though its use might be an issue because it can be unsafe to share multiple applications under mod_perl. Since early 2008, Catalyst applications can also be deployed using the HTTP::Prefork engine which provides for the deployment of high performance Catalyst applications without a separate web server. Starting with the release of Catalyst 5.9, Catalyst also outputs to the
PSGI Plack is a Perl web application programming framework inspired by Rack for Ruby and WSGI for Python, and it is the project behind the PSGI specification used by other frameworks such as Catalyst and Dancer. Plack allows for testing of Perl w ...
spec thus it can be run on any Plack server and along with any server or protocol that supports the PSGI spec, including Mongrel2.


Database support

Catalyst can run using any database supported by Perl's DBI (this means almost anything, even a CSV file), but a proper
RDBMS A relational database (RDB) is a database based on the relational model of data, as proposed by E. F. Codd in 1970. A Relational Database Management System (RDBMS) is a type of database management system that stores data in a structured forma ...
or ODBMS is recommended. The database access is entirely abstracted from the programmer's point of view and Catalyst, through one of its model classes, handles access to all databases automatically – though, if needed, using direct
SQL Structured Query Language (SQL) (pronounced ''S-Q-L''; or alternatively as "sequel") is a domain-specific language used to manage data, especially in a relational database management system (RDBMS). It is particularly useful in handling s ...
queries is possible. This enables database-neutrality, application portability over different database systems, and usability of pre-existing databases for Catalyst application development as much as possible, though due to different feature sets of the RDBMSes, it is not completely guaranteed by the framework alone. Several different RDBMS systems are supported, including
MySQL MySQL () is an Open-source software, open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A rel ...
,
PostgreSQL PostgreSQL ( ) also known as Postgres, is a free and open-source software, free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance. PostgreSQL features transaction processing, transactions ...
,
SQLite SQLite ( "S-Q-L-ite", "sequel-ite") is a free and open-source relational database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it ...
, IBM Db2,
Oracle An oracle is a person or thing considered to provide insight, wise counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. If done through occultic means, it is a form of divination. Descript ...
and
Microsoft SQL Server Microsoft SQL Server is a proprietary relational database management system developed by Microsoft using Structured Query Language (SQL, often pronounced "sequel"). As a database server, it is a software product with the primary function of ...
. For ODBMSes, there is explicit support for KiokuDB via Catalyst::Model::KiokuDB. The
Model A model is an informative representation of an object, person, or system. The term originally denoted the plans of a building in late 16th-century English, and derived via French and Italian ultimately from Latin , . Models can be divided in ...
abstraction allows databases of any nature to be accessed via Catalyst::Model::Adaptor. Many Catalyst-based projects use DBIx::Class as the ORM layer, which provides further abstraction of SQL queries, using a resultset-based API with transparent support for arbitrary joins and other features.


Uses

Websites powered by Catalyst include Magazines.com, bbc.co.uk iPlayer backend, DuckDuckGo's Community Platform, http://flexibase.io and Tripwolf.com. The MojoMojo wiki engine is written using Catalyst. YouPorn was powered by Catalyst until 2012.


See also

* Comparison of web frameworks


References

*


External links

*
Catalyst Wiki

Catalyst on CPAN
{{DEFAULTSORT:Catalyst (Software) Free software programmed in Perl Perl software Web frameworks