YAPC::Europe 2011 in Riga

YAPC::Europe 2011 “Modern Perl”

Twitter #ye2011    RSS       Log in

Integrating an external model with an existing Catalyst environment

By Daniel Böhmer from Leipzig.pm
Lightning talk
Target audience: Any
Language: English
Tags: architecture catalyst mvc rdbo science

You can find more information on the speaker's site:


In the lightning talk we would like to present the main idea of our application architecture to inspire intermediate Catalyst users and get feedback. This is what our application is about:

To provide a safe and stable scientific data retrieval and long-term archive system we are using a software system based on Perl which is able to handle a flexible client–server architecture.
Catalyst being developed as an MVC framework (Model-View-Controller) is a great benefit when building a wide variety of different web applications.
One part of our model uses the high-performance object-relational mapper RDBO (Rose::DB::Object). With its help the relationships of the database content can be represented by Perl objects in arbitrary depth.
Due to complex requirements of the web application in various aspects it is necessary to create an application model instead of letting the controller directly access the RDBO modules. Additional objects and methods for manipulating them are implemented with the postmodern object system Moose.
The MVC concept of Catalyst allows replacing the preferred model or the preferred view (e. g. Template::Toolkit, HTML::Template) while our application model is independently accessible from both Catalyst and other controllers like command-line programs.
Catalyst's model receives commands from the Catalyst controller and redirects them to the underlying application model. An additional controller can act independently from Catalyst – e. g. to provide another interface not based on Catalyst or not WWW oriented at all.
We intend to adapt our MVC to be most flexible making future modifications affordable.
The replaceability will be finally extended to each of the three parts of the MVC system.
To extend the original Catalyst concept the CPAN module Catalyst::Model::Adaptor was used and a factory class was added to the application model. Our presentation will show some essential points and the improved flexibility of our adapted MVC concept.