Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 1 Catalyst in 40 minutes An Introduction to Catalyst YAPC::EU 2005 Braga, Portugal Marcus Ramberg,

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Introduction to Rails.
Advertisements

Mod_perl High speed dynamic content. Definitions Apache – OpenSource httpd server Perl – OpenSource interpreted programming language mod_perl – OpenSource.
Other Web Application Development Technologies. PHP.
12 October 2011 Andrew Brown IMu Technology EMu Global Users Group 12 October 2011 IMu Technology.
Web Toolkit Julie George & Ronald Lopez 1. Requirements  Java SDK version 1.5 or later  Apache Ant is also necessary to run command line arguments 
Presenter: James Huang Date: Sept. 29,  HTTP and WWW  Bottle Web Framework  Request Routing  Sending Static Files  Handling HTML  HTTP Errors.
A Blackboard Building Block™ Crash Course for Web Developers
1.  Understanding about How to Working with Server Side Scripting using PHP Framework (CodeIgniter) 2.
Getting started with ExtJS Javascript screen library and Catalyst Perl framework – Perl Mova 2008, Kyiv, Ukraine 1 Getting started with ExtJS and Catalyst.
Ruby on Rails by Manik Juneja Ruby On Rails. Ruby on Rails by Manik Juneja Rails is a Web Application development framework. Based on the MVC pattern.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
ExtJS 4.0 JavaScript MVC Framework. Who ExtJS is provided by Sencha ( o Sencha Touch o GWT o CSS Animator o IO (Cloud Data Management)
Struts Basics SSE USTC Qing Ding. Agenda What is and Why Struts? Struts architecture – Controller: Focus of this presentation – Model – View Struts tag.
-Uday Dhokale.  What is it ??? Prototype is a JavaScript Framework that aims to ease development of dynamic web applications.  Features a unique, easy-to-use.
Direct Congress Dan Skorupski Dan Vingo. Inner workings Reminder: MVC design pattern Procedural view: From request to response o Request passed to a view.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Simple Web SQLite Manager/Form/Report
An Introduction to ASP.NET Web Pages 2 Module 1: Webmatrix Installation and Your First Web Site Tom Perkins.
UNIT-V The MVC architecture and Struts Framework.
RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
WebWork in Action An introduction to WebWork Patrick A. Lightbody.
Mod_lua for beginners Eric Covener, IBM November 2011.
ZFApp Preview Walkthrough. What is ZFApp? ZFApp is an application framework built on top of Zend Framework Fully compatible with the latest ZF Versions.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Web Servers Web server software is a product that works with the operating system The server computer can run more than one software product such as .
CodeIgniter - [Overview]
AIT 616 Fall 2002 PHP. AIT 616 Fall 2002 PHP  Special scripting language used to dynamically generate web documents  Open source – Free!!!  Performs.
Ajax Runtime Toolkits IBM Emerging Technologies. What is an AJAX Toolkit/Framework? An AJAX Toolkit/Runtime is more than just XMLHTTPRequest Should includes:
Presentation: SOAP in a distributed object framework, Application Servers & AXIS SOAP.
Java Users Group Charleston, SC June 25, 2008 Introduction to Grails by Jason McDonald.
Lecture 19 Web Application Frameworks Boriana Koleva Room: C54
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Introduction to Model-Glue Rachel Lehman Perpetual Intermediate Designer-Developer Introduction to Model-Glue.
Ruby on Rails Your first app. Rails files app/ Contains the controllers, models, views and assets for your application. You’ll focus on this folder for.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
Lecture 11 Rails Topics SaaSSaaS Readings: SaaS book Ch February CSCE 740 Software Engineering.
Arnold Geraldo Designing and Making of The Online Auction Website Using CakePHP Framework.
Lap Around Visual Studio 2008 &.NET 3.5 Enhancements.
Templates, Databases and Frameworks. Databases: DBI Common database interface for perl Provides a functional,
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
First Indico Workshop WEB FRAMEWORKS Adrian Mönnich May 2013 CERN.
Eagle: Maturation and Evolution 17th Annual Tcl Conference Joe Mistachkin.
Selenium and Selenium on Rails. Agenda  Overview of Selenium Simple Selenium Tests Selenium IDE  Overview of Selenium on Rails  Problems with Selenium.
Rails & Ajax Module 5. Introduction to Rails Overview of Rails Rails is Ruby based “A development framework for Web-based applications” Rails uses the.
AxKit A member of the Apache XML project Ryan Maslyn Kyle Bechtel.
 Registry itself is easy and straightforward in implementation  The objects of registry are actually complicated to store and manage  Objects of Registry.
Building a Web API for browser/JSON clients.
Trunica Inc. 500 East Kennedy Blvd #300 Tampa, FL Cross Platform Mobile Apps With Cordova and Visual Studio 2015 © Copyright 2015.
ICM – API Server & Forms Gary Ratcliffe.
ICM – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under.
Date : 3/04/2010 Web Technology Solutions Class: PHP Web Application Frameworks.
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Shibboleth 1.2 Technical Overview “So you thought 1.1 was complicated…” Scott Cantor The Ohio State University and Internet2 Scott Cantor.
APACHE STRUTS ASHISH SINGH TOMAR ast2124. OUTLINE Introduction The Model-View-Controller Design Pattern Struts’ implementation of the MVC Pattern Additional.
Ruby on Rails. Web Framework for Ruby Designed to make it easier to develop, deploy, and maintain web applications Design with Model-View-Controller –almost.
Modern Development Technologies in SharePoint SHAREPOINT SATURDAY OMAHA APRIL, 2016.
APP DESIGN AND DEVELOPMENT WITH THE IONIC FRAMEWORK Chuck Leone
Web Technology Solutions
Building Secure ColdFusion Applications
Selenium and Selenium on Rails
Node.js Express Web Applications
Data Virtualization Tutorial… CORS and CIS
Play Framework: Introduction
Node.js Express Web Services
J2EE Lecture 7: Spring – Spring MVC
Ruby on Rails by Manik Juneja
Ruby on Rails by Manik Juneja
Office 365 Development.
Presentation transcript:

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 1 Catalyst in 40 minutes An Introduction to Catalyst YAPC::EU 2005 Braga, Portugal Marcus Ramberg, The Cabal

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 2 About me ● Name: Marcus Ramberg ● A/S/L: 28/No thanks, I'm married/Oslo,Norway ● Co-maintainer of Catalyst ● ● Oslo Perlmonger ● Working for ABC Startsiden ● magnet :-)

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 3 Overview ● What is Catalyst? ● Catalyst is a new MVC framework for Perl. Catalyst borrows from other frameworks, such as Ruby on Rails and Apache Struts, but its main goal is to be a flexible, powerful, and fast framework for developing any type of web project in Perl. ➔ Introduction to Catalyst. ➔ Overview ➔ Features ➔ Ajax autocompletion screencast ➔ Scaffolding screencast ➔ From scaffolding to app – BookDB ➔ Conclusion

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 4 Overview

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 5 Some Numbers ✔ 10 Engines (Apache,FastCGI,Standalone +++) ✔ 8 models (CDBI,Tangram,DBIC, Xapian +++) ✔ 6 supported views ( TT,Mason,H-T,Petal +++) ✔ 48 plugins in trunk (Session, Forms, Cache +++) ✔ 16,539 Total Physical Source Lines of Code (Catalyst trunk) ✔ 445 tests ✔ 1077 committed revisions ✔ 50% chance Gabbana is drunk

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 6 The Context object ● traditionally named $c ● Instance of your main application ● Subclass of the Catalyst application ● All plugins are part of the context through multiple inheritance ● Passed around with the forwarding mechanism to controllers and views ● Provides access to Request and Response objects as well as the Stash.

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 7 Request / Response ● Platform independent API ● Engines populate Request before dispatching, and parse Response after the actions ● Provides unified access to request params - – request->param('name') ● Provides a simple access for HTTP Uploads ● Using for request and response headers ● Currently using scalars. Next release will support IO for uploads and serving large content.

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 8 The Stash ● “An universal hash” – $c->stash->{item}=MyApp::M::Item->retrieve($item_id); ● Request lifetime ● How to communicate between actions, and with templates ● Variables in stash are automatically-exposed to views.

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 9 The Dispatcher ● Dispatches to actions based on URI path ● Actions defined as attributes: – sub hello : Local {} ● All actions listed at startup ● Matching private action namespace for forwarding. – c->forward('/ / '); – works like a eval cage for a function call – continues processing! If that`s not what you want, use detach – pass arguments with a hashref ● Redispatch within your application? – Catalyst::Plugin::SubRequest

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 10 The Actions ● action types: – : Global – matches /, no matter what controller – : Local – controller sensitive. / / – : Path – Matches specified path; sub test : Path('/t/t/test') – : Regex – regular expressions – : Private – not available from URL – only for forwarding ● Builtin: – default - fallback – auto – allows you to stop dispatching – return 0; – begin – before dispatching – can be overridden in Controllers – end – after dispatching – Typically forward to view.

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 11 Development Environment ● Code Generation ● Standalone Server ● Debug screen ● Extendable Logging integration – Catalyst::Log::Dispatch – Catalyst::Log::Color ● Full API documentation

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 12 Deployment ● Engines provide platform independence – Apache (ModPerl 1/1.9/2) – IIS (FastCGI) – Zeus – POE – SpeedyCGI – Standalone Server ● Helper makes framework for installation/testing ● Uses standard CPAN deployment mechanisms ● Auto-detection of Application root ● Easily use external configuration files.

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 13 Auto complete screencast ● Making a simple Catalyst application ● Like “Google Suggest” ● AJAX Powered ● Using Catalyst::Plugin::Prototype – Wrapping HTML::Prototype – A port of the Rails javascript helpers. – Now also including script.aculo.us effects, draganddrop and controls library. ● scripts/myapp_create.pl Prototype to generate javascript files for inclusion in your app.

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 14 Scaffolding ● Using the Catalyst Helper API – scripts/myapp_create.pl controller Scaffolding ● Simple scaffolding. Low on magic, high on carbohydrates. ● Build your app around the Scaffolding, not the other way around. ● Use as much or as little as makes sense. ● Lets watch the Screencast

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 15 BookDB ● From Scaffolding to application ● Maypole CRUD application I built in january ● So let us take the bookdb.sql and see what we can do. ● First – build the skeleton – catalyst.pl BookDB ● Make the db – sqlite3 book.db <../bookdb.sql ● And then the model – script/bookdb_create.pl model BookDB CDBI dbi:sqlite:book.db

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 16 BookDB ● Create the view: – script/bookdb_create.pl view TT TT ● Now let's try to get the scaffolding up: – script/bookdb_create.pl controller Book Scaffold BookDB::Book ● Add a few plugins to Bookdb.pm: – use Catalyst qw/-Debug FormValidator FillInForm DefaultEnd/; ● And while we are there, let's change Default: – $c->forward('/book/default'); ● Finally, add a couple of required CDBI plugins: – additional_base_classes => [qw/Class::DBI::AsForm Class::DBI::FromForm/],

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 17 BookDB ● All right, scaffolding is up and running, now what? ● Those columns are a bit messy. – __PACKAGE__->columns(list=>qw/title author publisher year/); – [% FOR column = table_class.columns('list') %] ● ● Want fancy labels? Write them. ● Validation? Change the DFV profile: – required => [qw /title author/], – constraints => {year => qr/^\d{4}$/}

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 18 ● Adding books from Amazon – Thanks to Simon Cozens for this trick. ● Adding basic support for checking out books ● At this point we hand it over to Gabb! ● Code available in Catalyst trunk – s/BookDB s/BookDB

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 19 Handel Demo ● Handel is a quick and not-so-dirty ecommerce framework with AxKit taglib support and TT2 (Template Toolkit) support. It was started for the conversion of an IIS/ASP based commerce site to Apache/ModPerl, but CLACO decided to release it to CPAN. Handel also works well with Catalyst: – catalyst.pl MyApp – sqlite < handel.sql – myapp_create.pl Handel::Scaffold dbi:SQLite:dbname=/tmp/handel.db – ● Helpers soon to be released

Introduction to Catalyst - YAPC::EU 2005 Braga, Portugal 20 Questions? ● Q: So Catalyst looks good, but I heard it was part of a secret plan by The Cabal to undermine CPAN by flooding it with Catalyst modules? ● A: There is no Cabal. ● Others? No? Really? Ok, if you have a question later: ● mailinglist: ● irc irc.perl.org ● My phone number: ● Only for hot chicks ;-)