ebook img

Catalyst 5.8, the Perl MVC Framework: Build scalable and extendable web applications using the Agile MVC framework PDF

244 Pages·2010·3.93 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Catalyst 5.8, the Perl MVC Framework: Build scalable and extendable web applications using the Agile MVC framework

Catalyst 5.8 The Perl MVC Framework Build scalable and extendable web applications using the Agile MVC framework Antano Solar John BIRMINGHAM - MUMBAI Catalyst 5.8 The Perl MVC Framework Copyright © 2009 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: June 2010 Production Reference: 1220610 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-847199-24-9 www.packtpub.com Cover Image by Vinayak Chittar ([email protected]) Credits Author Editorial Team Leader Antano Solar John Aanchal Kumar Reviewer Project Team Leader Robert Sedlacek Priya Mukherji Acquisition Editor Project Coordinator Douglas Paterson Leena Purkait Development Editor Proofreader Dhiraj Chandiramani Lynda Sliwoski Technical Editor Graphics Smita Solanki Geetanjali Sawant Indexer Production Coordinator Monica Ajmera Mehta Aparna S. Bhagat Cover Work Aparna S. Bhagat About the Author Antano Solar John is a tech evangelist who is passionate about using technology to revolutionize the learning experience! He authored his first book on MODx with Packt in 2008 which was also the first book ever written on this platform. Antano has contributed massively to the open source community in terms of documentation, code, and support on various platforms based on PHP, Perl, Lisp, Python, Ruby, and so on. His contribution to the open source world has allowed him to meet and model from a variety of people who have learned to code and think naturally! His writing skills benefit from this advantage thereby bringing structure and clarity to the learner. Antano's first technical publication titled "Help AI Help You-Swiss Knife of Communication" was on Communication and Machine Learning using Neuro Linguistic Programming (NLP) concepts such as Meta Modelling and Deep Structures, which was critically acclaimed by communication and technology experts. He has also been recently certified as a licensed NLP practitioner by its cofounder Richard Bandler. Other papers by Antano include "802.11 MAC Enhancements-Breaking Barriers of Wireless Speed" that was published in the IEEE Journal, "Learning to Develop in the Open Source World", and so on. Owing to his experience as a consultant and trainer, Antano has designed course structure and content for corporate learners at different levels on subjects such as Object Oriented Perl, Unix System Fundamentals, Shell basic, Ruby on Rails, and so on. In association with MaFoi Ranstad, Antano entirely designed and implemented a structured course for transitioning web designers into developers through a one-day blended learning program called "Learn". Antano has been keenly focusing on Accelerated Learning. He has conducted workshops at various reputed colleges and corporate events on how to learn quickly and effectively-technology languages and platforms using strategies that he has developed. His experience with NLP, which is the science of Modelling Excellence has helped him with this effort. As part of his consultant assignments he has worked on Catalyst from its early stages. He has been a consultant and a trainer providing IT solutions and sessions on VoIP, networks, and software platforms, and languages. Currently, he is the Chief Technology Officer (CTO) at NuVeda Learning. In his present role, he is responsible for accelerated learning solutions which leverages technology for speed and scale. Antano's other interests include Music, Dance, Martial Arts, and Chess. He used to play Chess professionally as a child. Antano used to run a successful gaming business when gaming as a business was almost unheard of. He has also won the yahoo hack award twice in India consequently, once for developing a Collaborative Browsing Mechanism using lines of code shorter than this biography without any server or proxy and then yet again for developing a Hybrid Search Engine from scratch in 24 hours that uses Machine and Social Intelligence to identify, search, and distill information in contexts you expect! I first like to thank the Catalyst Community without whom this book could have never been possible. I also convey my gratitude to the original author Jonathan, other members of the community like Matt S. Trout, Jess Robinson along with all those who taught me Catalyst! Special appreciation to the reviewer Robert Sedlacek and the Packt team (Leena Purkait , Dhiraj Chandiramani, and Smita Solanki) for continually providing valuable inputs to improve the reading experience. About the Reviewer Robert Sedlacek started programming at the age of 17 while working as computer hardware technician. He started out with Perl, took a four-year break into other platforms and has been developing in Perl ever since. Today he is working as a general Perl contractor but also specializes in web application development with Catalyst. Table of Contents Preface 1 Chapter 1: Introduction to Catalyst 7 Catalyst application architecture 8 Extensibility 9 Reusability 10 Flexibility 10 Reliability 11 Installing Catalyst 11 CPAN 12 Testing the installation 13 Where to go for help? 13 Summary 14 Chapter 2: Creating a Catalyst Application 17 Creating the application skeleton 17 Latest helper scripts 23 Files in the MyApp directory 23 Files in the lib directory 24 Files in the root directory 24 Files in the script directory 25 Files in the t directory 25 Handling URL requests 26 Adding a View 28 More on Controller methods 32 Some technical details 35 Adding a database 35 Installing SQLite 36 Creating a database schema 36 Table of Contents Creating a database model for Catalyst 37 Using the Model 37 Summary 39 Chapter 3: Building a Real Application 41 Environment setup 41 Database design 42 Understanding the interface to the database 44 TTSite 48 Creating the index page 50 Creating a "Not Found" page 51 Viewing people 52 Basic CRUD 55 Forms 56 Finishing up 60 Summary 65 Chapter 4: Expanding the Application 67 Configuration files 67 Configuring the address book 69 Sessions 70 Adding sessions to the address book 71 Sessions in the database 73 Using components from outside Catalyst 75 Searching and paging 79 Authentication and authorization 87 Authentication 87 Authorization 89 Adding authentication and authorization to the address book 91 Summary 101 Chapter 5: Building a More Advanced Application 103 The application 103 Background 106 Creating the database 106 Populating the database 110 Extracting the data 114 Chained resultsets 118 Custom resultsets 120 Putting the data on the Web 120 Summary 139 [ ii ] Table of Contents Chapter 6: Building Your Own Model 141 Creating a database model from scratch 141 Extending a DBIx::Class model 143 Custom methods without raw SQL 145 Calling database functions 145 Implementing a Filesystem model 146 Tweaking the model 150 Request context inside the model 151 Maintainable models 152 Other components 154 Summary 154 Chapter 7: Hot Web Topics 155 REST 155 Getting some REST 157 REST Controller 157 REST authentication 158 Adding an entity 159 REST easy 165 AJAX 165 Getting started 166 Jemplate 166 Implementing AJAX 168 RSS 173 Summary 175 Chapter 8: Moose 177 Moose introduction 177 OO in Perl 177 OO in Moose 178 Properties 179 Class method 179 Instantiating objects 180 Inheritance 180 Moose in Catalyst 181 Controller 182 CatalystX declare 182 CatalystX 185 Roles 185 Types 186 Model 187 Immutable 188 Summary 188 [ iii ]

Description:
The book is written in an exploratory style: try something and then understand how it works. It will guide you through the features of Catalyst using real-world examples and systematic code snippets. If you are a Perl Developer and want to strengthen your skill by understanding Web Application devel
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.