Traits, r?les and other repurposed terms

Matt S Trout dbix-class at trout.me.uk
Sat Feb 9 14:40:24 GMT 2008


On Fri, Feb 08, 2008 at 05:23:59AM -0800, Ovid wrote:
> --- Abigail <abigail at abigail.be> wrote:
> 
> > (Of course, "roles" is just "multiple inheritance" with a different
> > name.
> 
> With all due respect, this is not even remotely true.

Objects are a poor man's closures.

Closures are a poor man's objects.

Multiple inheritance is a poor man's role application system.

Role application is a poor man's multiple inheritance.

Certainly I've found the core effects of MI with a C3 MRO and of roles
to be remarkably similar - anything in MI that calls next::method is a
method modifier, anything that doesn't is a plain method. Conflict
detection and resolution and similar is just tooling built on top; while
I find myself reaching for roles instead of MI now 99 times out of 100
DBIC's component system is built out of C3+MI and with a little programming
discipline provides pretty much the same result.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/


More information about the london.pm mailing list