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.
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?
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!
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.
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..
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
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.
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