SlideShare a Scribd company logo
1 of 42
Herding a Cat with
        Antlers
New toys for writing a modern Catalyst application




  Tomas Doran (t0m) <bobtfish@bobtfish.net>
Who am I?



     (Mostly)
“Catalyst 5.80
Chainsaw delegate”
Said mst




(I’m sure he’s regretted this a time or two)
So, basically:
   I add all the bugs..


        Got it?
        Great!
This talk

• 25% rant / ramble about Catalyst 5.80
• 50% rapid run through new Catalyst
  extensions and Moose features
• 25% new developments and the future.
• NOT a Catalyst intro, sorry.
Theme fail
  This doesn’t really fit into ‘beginning perl’.




  I’ll be happy to try for ‘Beginning being a
Catalyst dev’ by handing commit bits out later
Catalyst 5.80
• Released April 2009
• Next major release series - 18 months
  work
• 15 stable releases this year
• Backward compatible with 5.71, 5.70 etc..
• New features! Less bugs!?!
Moose port
• Catalyst is not designed for trivial
  applications.
• Serious apps (iPlayer, rambler.ru, youporn),
  serious OO. Needs a serious framework.
• Class::Accessor::Doesn’t::Cut::The::Mustard
• Antlers are awesome!!
Extensions!
• Catalyst is all about customisation.
• Moose Roles are much better than multiple
  inheritance.
• Catalyst without CatalystX == perl5
  without CPAN - not so useful.
• Getting (even) more extensible == big win.
Moose

• Attributes (automatically filled from config)
• Type constraints (config validation)
• Method modifiers
• Powerful delegation
• Did I mention roles?
Component attributes

• Models/Views/Controllers can require
  attributes (with types).
• This data is supplied from config
• Access it as $self->attribute
• YES - you could do this before!
Component attributes
Delegation

• Attributes and the ‘handles’ feature are as
  powerful, if not more powerful than roles.
• Delegation is often better than inheritance
  or composition
• Delegate all of the methods required in an
  ‘interface’ role
Delegation
Roles Roles Roles
• Application class roles
• Controller roles (with method attributes)
• Request / Response roles
• Action roles
• CPAN modules to help with most of these.
• Prior art to steal!
Method modifiers


• Run code before / after methods, or wrap
  them with around.
• Composable
Method modifiers
Another example
App class roles

• Things which used to be plugins can now
  be roles.
• Affect things application wide as they
  change the $c object.
• Useful, but don’t make a god object!
App class roles
New CPAN shiny!

• Catalyst::Controller::ActionRole
• CatalystX::RoleApplicator
• MooseX::MethodAttributes::Role
• CatalystX::Components::Traits
• Catayst::Traitfor::XXX::YYY
Action Roles

•   Everyone has seen :ActionClass(‘RenderView’)

•   You can only have 1 ActionClass

•   This sucks

•   Catalyst::Controller::ActionRole gives
    you :Does(‘ActionRoleName’)

•   (You don’t really need action classes at all)
Catalyst::Controller::ActionRole
CatalystX::RoleApplicator

• Use it in your app to apply roles to
  Request/Response/Engine/Dispatcher etc
• Use it in your components/plugins rather
  than monkey patching or subclassing.
CatalystX::RoleApplicator
MooseX::MethodAttributes::Role


• Controller actions can be in roles.
• Use for common path end-points (E.g.
  CRUD)
• Use for common controller functionality
MooseX::MethodAttributes::Role
MooseX::MethodAttributes::Role
CatalystX::Components::Traits


• Apply (or remove) roles for your
  application components with config.
• E.g. Change ACLs applied in different
  environments.
CatalystX::Component:
Catalyst::TraitFor::XXX:YYY

•   CatalystX::SimpleLogin::TraitFor::Controller::Login::WithRedirect

•   Catalyst::TraitFor::Model::DBIC::Schema::Replicated

•   Catalyst::TraitFor::Controller::DBIC::DoesPaging



•   Don’t have to use CatalystX::Component::Traits - just roles, with
    is fine if you don’t need to set them via config..
That’s what we did
     this year!
This week

• I’m pleased to announce Catalyst-Runtime
  5.80015 and Catalyst-Devel 1.22
• New scripts system from the Google
  Summer of code.
• Moose ‘native’ application generation
The future
• More docs (yes, the tutorial still needs
  updating)
• More deprecations (sorry!)
• Continual improvement of the 5.80XXX
  series.
• Core features - Action roles? Unicode
  handling?
• 5.81 - App / ctx split - branch underway
Thanks


Tomas Doran (t0m) <bobtfish@bobtfish.net>

               #catalyst
Redux


• Sorry, I was lieing.
• I haven’t finished.
U R DOIN IT RONG

• I’ve just shown off lots of fancy tricks.
• This DOES NOT MEAN you use only
  those.
• This DOES NOT MEAN all your logic
  goes in Catalyst, especially not in
  controllers.
Beware your app
 getting too fat
CATALYST IS JUST
        GLUE
• ALL of your business logic should exist
  OUTSIDE CATALYST

• If you’re doing heavy lifting, it should
  happen outside your web application
  process.
• Your availability being AT BEST that of
  remote services is a bad world.
This does mean

• You develop independent components
  using Moose / Roles / etc
• You tie these into Catalyst as models with a
  thin layer of glue.
• You reuse common workflows in Catalyst
  between your apps
Obligatory pony

More Related Content

What's hot

Ebay legacy-code-retreat
Ebay legacy-code-retreatEbay legacy-code-retreat
Ebay legacy-code-retreat
Konrad Malawski
 
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
seleniumconf
 

What's hot (20)

C# Async/Await Explained
C# Async/Await ExplainedC# Async/Await Explained
C# Async/Await Explained
 
Ebay legacy-code-retreat
Ebay legacy-code-retreatEbay legacy-code-retreat
Ebay legacy-code-retreat
 
Integration and Acceptance Testing
Integration and Acceptance TestingIntegration and Acceptance Testing
Integration and Acceptance Testing
 
Developers’ mDay 2021: Mladen Janjetović, Laravel Srbija – Laravel Awesome
Developers’ mDay 2021: Mladen Janjetović, Laravel Srbija – Laravel AwesomeDevelopers’ mDay 2021: Mladen Janjetović, Laravel Srbija – Laravel Awesome
Developers’ mDay 2021: Mladen Janjetović, Laravel Srbija – Laravel Awesome
 
Unit testing hippo
Unit testing hippoUnit testing hippo
Unit testing hippo
 
Intro to Flux - ReactJS Warsaw #1
Intro to Flux - ReactJS Warsaw #1Intro to Flux - ReactJS Warsaw #1
Intro to Flux - ReactJS Warsaw #1
 
Scala days2013 proxyfactorybeandelegate
Scala days2013 proxyfactorybeandelegate Scala days2013 proxyfactorybeandelegate
Scala days2013 proxyfactorybeandelegate
 
React For Vikings
React For VikingsReact For Vikings
React For Vikings
 
API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)
 
Functional REST API testing in ASP.NET Core
Functional REST API testing in ASP.NET CoreFunctional REST API testing in ASP.NET Core
Functional REST API testing in ASP.NET Core
 
Variables in Pharo5
Variables in Pharo5Variables in Pharo5
Variables in Pharo5
 
Test driven APIs with Laravel
Test driven APIs with LaravelTest driven APIs with Laravel
Test driven APIs with Laravel
 
Laravel Webcon 2015
Laravel Webcon 2015Laravel Webcon 2015
Laravel Webcon 2015
 
Anatomy of a Reactive Application
Anatomy of a Reactive ApplicationAnatomy of a Reactive Application
Anatomy of a Reactive Application
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj Rollison
 
Clojure 1.8 Direct-Linking WWH
Clojure 1.8  Direct-Linking  WWHClojure 1.8  Direct-Linking  WWH
Clojure 1.8 Direct-Linking WWH
 
Episode 2 conditional flows & loops
Episode 2   conditional flows & loopsEpisode 2   conditional flows & loops
Episode 2 conditional flows & loops
 
OSCamp 2019 | #3 Ansible: Automated Tests of Ansible code with GitLab, Vagran...
OSCamp 2019 | #3 Ansible: Automated Tests of Ansible code with GitLab, Vagran...OSCamp 2019 | #3 Ansible: Automated Tests of Ansible code with GitLab, Vagran...
OSCamp 2019 | #3 Ansible: Automated Tests of Ansible code with GitLab, Vagran...
 
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
 
Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...Selenium course training institute ameerpet hyderabad – Best software trainin...
Selenium course training institute ameerpet hyderabad – Best software trainin...
 

Similar to Herding a Cat with Antlers - Catalyst 5.80

Similar to Herding a Cat with Antlers - Catalyst 5.80 (20)

Rails 5 subjective overview
Rails 5 subjective overviewRails 5 subjective overview
Rails 5 subjective overview
 
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
 
Tensorflow 2.0 and Keras ODSC Jan 2019
Tensorflow 2.0 and Keras ODSC Jan 2019Tensorflow 2.0 and Keras ODSC Jan 2019
Tensorflow 2.0 and Keras ODSC Jan 2019
 
Microservices: The Best Practices
Microservices: The Best PracticesMicroservices: The Best Practices
Microservices: The Best Practices
 
Kevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScriptKevin Whinnery: Write Better JavaScript
Kevin Whinnery: Write Better JavaScript
 
Design p atterns
Design p atternsDesign p atterns
Design p atterns
 
Gradle Again
Gradle AgainGradle Again
Gradle Again
 
The DITA Iceberg, DITA Europe 2016
The DITA Iceberg, DITA Europe 2016The DITA Iceberg, DITA Europe 2016
The DITA Iceberg, DITA Europe 2016
 
Rails traps
Rails trapsRails traps
Rails traps
 
Grails Services
Grails ServicesGrails Services
Grails Services
 
Performant Django - Ara Anjargolian
Performant Django - Ara AnjargolianPerformant Django - Ara Anjargolian
Performant Django - Ara Anjargolian
 
DefCore: The Interoperability Standard for OpenStack
DefCore: The Interoperability Standard for OpenStackDefCore: The Interoperability Standard for OpenStack
DefCore: The Interoperability Standard for OpenStack
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
 
Features, Exportables & You
Features, Exportables & YouFeatures, Exportables & You
Features, Exportables & You
 
Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...
 
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React App
 
Bigger Unit Test Are Better
Bigger Unit Test Are BetterBigger Unit Test Are Better
Bigger Unit Test Are Better
 
Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013
 
stackconf 2022: Infrastructure Automation (anti) patterns
stackconf 2022: Infrastructure Automation (anti) patternsstackconf 2022: Infrastructure Automation (anti) patterns
stackconf 2022: Infrastructure Automation (anti) patterns
 
Infrastructure as Code Patterns
Infrastructure as Code PatternsInfrastructure as Code Patterns
Infrastructure as Code Patterns
 

More from Tomas Doran

Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)
Tomas Doran
 
London devops logging
London devops loggingLondon devops logging
London devops logging
Tomas Doran
 
Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012
Tomas Doran
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testing
Tomas Doran
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testing
Tomas Doran
 
Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new framework
Tomas Doran
 

More from Tomas Doran (20)

Empowering developers to deploy their own data stores
Empowering developers to deploy their own data storesEmpowering developers to deploy their own data stores
Empowering developers to deploy their own data stores
 
Dockersh and a brief intro to the docker internals
Dockersh and a brief intro to the docker internalsDockersh and a brief intro to the docker internals
Dockersh and a brief intro to the docker internals
 
Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
 
Building a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for DockerBuilding a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for Docker
 
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and JenkinsChasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
 
Deploying puppet code at light speed
Deploying puppet code at light speedDeploying puppet code at light speed
Deploying puppet code at light speed
 
Thinking through puppet code layout
Thinking through puppet code layoutThinking through puppet code layout
Thinking through puppet code layout
 
Docker puppetcamp london 2013
Docker puppetcamp london 2013Docker puppetcamp london 2013
Docker puppetcamp london 2013
 
"The worst code I ever wrote"
"The worst code I ever wrote""The worst code I ever wrote"
"The worst code I ever wrote"
 
Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)
 
Test driven infrastructure development
Test driven infrastructure developmentTest driven infrastructure development
Test driven infrastructure development
 
London devops - orc
London devops - orcLondon devops - orc
London devops - orc
 
London devops logging
London devops loggingLondon devops logging
London devops logging
 
Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testing
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testing
 
Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!
 
Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new framework
 
Zero mq logs
Zero mq logsZero mq logs
Zero mq logs
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Herding a Cat with Antlers - Catalyst 5.80

  • 1. Herding a Cat with Antlers New toys for writing a modern Catalyst application Tomas Doran (t0m) <bobtfish@bobtfish.net>
  • 2. Who am I? (Mostly)
  • 4. Said mst (I’m sure he’s regretted this a time or two)
  • 5. So, basically: I add all the bugs.. Got it? Great!
  • 6. This talk • 25% rant / ramble about Catalyst 5.80 • 50% rapid run through new Catalyst extensions and Moose features • 25% new developments and the future. • NOT a Catalyst intro, sorry.
  • 7. Theme fail This doesn’t really fit into ‘beginning perl’. I’ll be happy to try for ‘Beginning being a Catalyst dev’ by handing commit bits out later
  • 8. Catalyst 5.80 • Released April 2009 • Next major release series - 18 months work • 15 stable releases this year • Backward compatible with 5.71, 5.70 etc.. • New features! Less bugs!?!
  • 9. Moose port • Catalyst is not designed for trivial applications. • Serious apps (iPlayer, rambler.ru, youporn), serious OO. Needs a serious framework. • Class::Accessor::Doesn’t::Cut::The::Mustard • Antlers are awesome!!
  • 10. Extensions! • Catalyst is all about customisation. • Moose Roles are much better than multiple inheritance. • Catalyst without CatalystX == perl5 without CPAN - not so useful. • Getting (even) more extensible == big win.
  • 11. Moose • Attributes (automatically filled from config) • Type constraints (config validation) • Method modifiers • Powerful delegation • Did I mention roles?
  • 12. Component attributes • Models/Views/Controllers can require attributes (with types). • This data is supplied from config • Access it as $self->attribute • YES - you could do this before!
  • 14. Delegation • Attributes and the ‘handles’ feature are as powerful, if not more powerful than roles. • Delegation is often better than inheritance or composition • Delegate all of the methods required in an ‘interface’ role
  • 16. Roles Roles Roles • Application class roles • Controller roles (with method attributes) • Request / Response roles • Action roles • CPAN modules to help with most of these. • Prior art to steal!
  • 17. Method modifiers • Run code before / after methods, or wrap them with around. • Composable
  • 20. App class roles • Things which used to be plugins can now be roles. • Affect things application wide as they change the $c object. • Useful, but don’t make a god object!
  • 22. New CPAN shiny! • Catalyst::Controller::ActionRole • CatalystX::RoleApplicator • MooseX::MethodAttributes::Role • CatalystX::Components::Traits • Catayst::Traitfor::XXX::YYY
  • 23. Action Roles • Everyone has seen :ActionClass(‘RenderView’) • You can only have 1 ActionClass • This sucks • Catalyst::Controller::ActionRole gives you :Does(‘ActionRoleName’) • (You don’t really need action classes at all)
  • 25. CatalystX::RoleApplicator • Use it in your app to apply roles to Request/Response/Engine/Dispatcher etc • Use it in your components/plugins rather than monkey patching or subclassing.
  • 27. MooseX::MethodAttributes::Role • Controller actions can be in roles. • Use for common path end-points (E.g. CRUD) • Use for common controller functionality
  • 30. CatalystX::Components::Traits • Apply (or remove) roles for your application components with config. • E.g. Change ACLs applied in different environments.
  • 32. Catalyst::TraitFor::XXX:YYY • CatalystX::SimpleLogin::TraitFor::Controller::Login::WithRedirect • Catalyst::TraitFor::Model::DBIC::Schema::Replicated • Catalyst::TraitFor::Controller::DBIC::DoesPaging • Don’t have to use CatalystX::Component::Traits - just roles, with is fine if you don’t need to set them via config..
  • 33. That’s what we did this year!
  • 34. This week • I’m pleased to announce Catalyst-Runtime 5.80015 and Catalyst-Devel 1.22 • New scripts system from the Google Summer of code. • Moose ‘native’ application generation
  • 35. The future • More docs (yes, the tutorial still needs updating) • More deprecations (sorry!) • Continual improvement of the 5.80XXX series. • Core features - Action roles? Unicode handling? • 5.81 - App / ctx split - branch underway
  • 36. Thanks Tomas Doran (t0m) <bobtfish@bobtfish.net> #catalyst
  • 37. Redux • Sorry, I was lieing. • I haven’t finished.
  • 38. U R DOIN IT RONG • I’ve just shown off lots of fancy tricks. • This DOES NOT MEAN you use only those. • This DOES NOT MEAN all your logic goes in Catalyst, especially not in controllers.
  • 39. Beware your app getting too fat
  • 40. CATALYST IS JUST GLUE • ALL of your business logic should exist OUTSIDE CATALYST • If you’re doing heavy lifting, it should happen outside your web application process. • Your availability being AT BEST that of remote services is a bad world.
  • 41. This does mean • You develop independent components using Moose / Roles / etc • You tie these into Catalyst as models with a thin layer of glue. • You reuse common workflows in Catalyst between your apps