Last night I was speaking at the Milton Keynes Perl Mongers technical meeting. I gave a new talk about how Moose (and, in particular, Moose traits) make Perlanet easier to maintain and enhance. The slides are available on Slideshare.
Just another Perl Hacker's blog
Last night I was speaking at the Milton Keynes Perl Mongers technical meeting. I gave a new talk about how Moose (and, in particular, Moose traits) make Perlanet easier to maintain and enhance. The slides are available on Slideshare.
The start, with ‘Overriding this is hard’, reminds me ‘Constructor should not do any real work’ as in http://misko.hevery.com/code-reviewers-guide/flaw-constructor-does-real-work/ . Granted your constructor sometimes still does real work – with the _build_scrubber method – but you can easily sidestep that by providing ready made objects to the constructor.
Any chance of putting the slides up as a PDF-file somewhere? (You can’t download the PDF from slideshare without an account.)
I only read the slides, so I might have missed something in the talk, but I’m not quite sure you got this right. A role can implement methods and still be a role. And a trait is a plain ol’ role that’s used in a very specific circumstance (applied to a metaclass). For reference:
http://search.cpan.org/perldoc?Moose::Cookbook::Meta::Recipe3