O'Reilly logo

Catalyst 5.8 by Antano Solar John

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

In this chapter, we looked at alternate ways to access the data model. We first added the ability to execute raw SQL to a standard DBIC model, and contrasted the code with normal DBIC resultset access. Then, we completely eliminated DBIC and wrote a database Model that used DBI to run raw SQL on the database. Next, we created a Filesystem model from scratch, and learned how to use COMPONENT and ACCEPT_CONTEXT to integrate the Model with the Catalyst application. We also saw how using Catalyst::Model::Adaptor made writing a maintainable Model easier. Remember that the best practice is to always have the definition and behavior of the data in the model, which allows for the Controller to become a glue and as thin. The View can then be independent ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required