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

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Herding a Cat with Antlers - Catalyst 5.80

2,429
views

Published on

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.

Published in: Technology

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,429
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
32
Comments
0
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Transcript

    • 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)
    • 3. “Catalyst 5.80 Chainsaw delegate”
    • 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!
    • 13. Component attributes
    • 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
    • 15. Delegation
    • 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
    • 18. Method modifiers
    • 19. Another example
    • 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!
    • 21. App class roles
    • 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)
    • 24. Catalyst::Controller::ActionRole
    • 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.
    • 26. CatalystX::RoleApplicator
    • 27. MooseX::MethodAttributes::Role • Controller actions can be in roles. • Use for common path end-points (E.g. CRUD) • Use for common controller functionality
    • 28. MooseX::MethodAttributes::Role
    • 29. MooseX::MethodAttributes::Role
    • 30. CatalystX::Components::Traits • Apply (or remove) roles for your application components with config. • E.g. Change ACLs applied in different environments.
    • 31. CatalystX::Component:
    • 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
    • 42. Obligatory pony