When Simula 67 was introduced 40 years ago, modern OO was born. Unfortunately, though developers generally agree about classes, polymorphism and encapsulation, OO has always had a code smell due to four decades of disagreement over how to use inheritance. We’ll take a look at the debate and explain what the core problem is. Then we’ll solve is using Smalltalk-style traits, also known as “roles”.
Along the way, we’ll take a look at Java’s interfaces, Ruby’s mixins (well, they’re actually from a dialect of Lisp, but don’t tell anyone), scream in horror (and wonder) at Beta’s inheritance model and finally settle on Moose::Role, a robust trait implementation in Perl 5. Real-world examples from BBC code will be presented and along with descriptions of the problems we encountered along the way. Time permitting, we’ll also discuss future research into traits and some pitfalls developers may wish to be aware of.
Curtis “Ovid” Poe sits on the Board of Directors for The Perl Foundation and is a senior software engineer for the BBC. He has spoken at many conferences across the US and Europe, including OSCON. He’s one of the authors of the popular “Perl Hacks” book and has published articles in the Perl Review and on perl.com. He also led the project to rewrite Perl’s venerable Test::Harness and is heavily involved in the current Perl renaissance.
For information on exhibition and sponsorship opportunities at the conference, contact Sharon Cordesse at scordesse@oreilly.com
Download the OSCON Sponsor/Exhibitor Prospectus
Download the Media & Promotional Partner Brochure (PDF) for information on trade opportunities with O'Reilly conferences or contact mediapartners@ oreilly.com
For media-related inquiries, contact Maureen Jennings at maureen@oreilly.com
To stay abreast of conference news and to receive email notification when registration opens, please sign up for the OSCON Newsletter (login required)
Have an idea for OSCON to share? oscon-idea@oreilly.com
View a complete list of OSCON contacts