Traits, rôles and other repurposed terms

Ovid publiustemp-londonpm at
Fri Feb 8 12:39:54 GMT 2008

--- Jonathan Stowe <jns at> wrote:

> Having realized this and now I'm not struggling to find some meaning
> in the terms themselves it all becomes much clearer. 
> I'd still like a nice self-sufficient paragraph that explains the
> ideas without reference to some example code though.

I'll take a swing at this.

In OO programming, many of us get the manager/programmer example. 
Should they be subclasses of "employee"?  No, because an employee might
very well fill both roles.

(And that's why the term "roles" is a better term than "traits".)

So what happens is that you have an employee object which can implement
at either compile time or run time the "programmer" and/or "manager"

The other benefit of "roles" is that both an programmer and a manager
might be able to "dawdle", but an employee might do this by reading the
articles on and the manager might do it be
commenting on (*cough*).  When you ask an
employee to dawdle, how they dawdle depends on the context in which
you're asking them.

I'm not claiming that this is an easy thing to really understand, but
it's the cleanest way I've encountered of solving hard compositional


Buy the book  -
Perl and CGI  -
Personal blog -
Tech blog     -

More information about the mailing list