ArticleslgStudy

computer science

Catalyst (software)

Catalyst (software) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Catalyst (software) rather than just read about it. In short: Catalyst is a web application framework written in Perl and based on the model–view–controller (MVC) architectural pattern. It began in 2005 as a fork of the Maypole framework, initially intended to become Maypole 3.0, and subsequently developed as its supported successor.

Catalyst (software) — main illustration
Catalyst (software) — illustration

Key takeaways

  • Catalyst (software) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Catalyst (software) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Catalyst (software) from memory before moving on to harder problems.

Reference excerpt

Catalyst is a web application framework written in Perl and based on the model–view–controller (MVC) architectural pattern. It began in 2005 as a fork of the Maypole framework, initially intended to become Maypole 3.0, and subsequently developed as its supported successor. Catalyst is designed around the principles of don't repeat yourself (DRY), flexibility and reuse of existing Perl modules. Its model and view components can use a range of modules, while application-specific controller code can be supplemented by plugins providing functions such as authentication, session management and HTTP negotiation. Catalyst supports multiple web-server and deployment configurations, including CGI, FastCGI, mod_perl and PSGI, and can use databases supported through Perl DBI, with DBIx::Class commonly used as an object-relational mapping layer.

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 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" (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 and RIAs using the Catalyst::Plugin::Prototype module (prototype is an Ajax framework). 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! User Interface Library.

Web server support For development and testing, Catalyst has a built-in simple HTTP server. For production use, Apache, lighttpd, Hiawatha, Cherokee or nginx with FastCGI or mod_perl 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 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 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 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, PostgreSQL, SQLite, IBM Db2, Oracle and Microsoft SQL Server. For ODBMSes, there is explicit support for KiokuDB via Catalyst::Model::KiokuDB. The Model 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 Archived 1 September 2016 at the Wayback Machine 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 Diment, Kieren (8 July 2009). The Definitive Guide to Catalyst. Apress. ISBN 978-1-4302-2365-8. Archived from the original on 17 September 2009. Retrieved 9 September 2009.

External links Archive of official Website Catalyst Wiki Catalyst on CPAN

Illustrations

Catalyst (software) illustration

Worked examples

Example 1 — a first encounter with Catalyst (software)

Start with the simplest possible case. Write down what Catalyst (software) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Catalyst (software) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Catalyst (software) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Catalyst (software)

In research
Catalyst (software) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Catalyst (software) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Catalyst (software) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Free software programmed in Perl, Software using the GNU General Public License, Web frameworks, so understanding it makes those chapters shorter.
In everyday life
Look for Catalyst (software) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Catalyst (software)” →

How to study Catalyst (software) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Catalyst (software) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Catalyst (software) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Catalyst (software) in simple terms?

Catalyst is a web application framework written in Perl and based on the model–view–controller (MVC) architectural pattern. It began in 2005 as a fork of the Maypole framework, initially intended to become Maypole 3.0, and subsequently developed as its supported successor.

Why does Catalyst (software) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Catalyst (software)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Catalyst (software).

Tags

  • Free software programmed in Perl
  • Software using the GNU General Public License
  • Web frameworks

Keep exploring