Herding a Cat with Antlers - Catalyst 5.80
Upcoming SlideShare
Loading in...5
×
 

Herding a Cat with Antlers - Catalyst 5.80

on

  • 3,749 views

Catalyst 5.80 - the new major version allows you lots of new ways to build applications. This talk looks at some of the technologies you may want to use, and points out some examples and other modules ...

Catalyst 5.80 - the new major version allows you lots of new ways to build applications. This talk looks at some of the technologies you may want to use, and points out some examples and other modules you might want to look at on CPAN.

Statistics

Views

Total Views
3,749
Views on SlideShare
3,728
Embed Views
21

Actions

Likes
4
Downloads
32
Comments
0

3 Embeds 21

http://www.slideshare.net 17
http://www.linkedin.com 3
https://lti-examples.heroku.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Herding a Cat with Antlers - Catalyst 5.80 Herding a Cat with Antlers - Catalyst 5.80 Presentation Transcript

  • 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