Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Informal Poll: why aren't you using traits?

by Ovid (Cardinal)
on Nov 20, 2005 at 15:48 UTC ( [id://510279]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Informal Poll: why aren't you using traits?
in thread Informal Poll: why aren't you using traits?

Problems they solve/when to use them:

  • Whenever you've duplicated behavior across unrelated classes.
  • Any time you might think about MI and it's only for code reuse (in other words, the subclass is not a more specific type of a super class)
  • Any time you might want a Java-style interface but you also want an implementation to go with that.
  • Any time you might want to use mixins (have you ever considered exporting methods?)

Cheers,
Ovid

New address of my CGI Course.

  • Comment on Re^2: Informal Poll: why aren't you using traits?

Replies are listed 'Best First'.
Re^3: Informal Poll: why aren't you using traits?
by tilly (Archbishop) on Nov 20, 2005 at 19:56 UTC
    As I said, I don't need them. But you may want to look at Class::Trait's documentation with an eye to making those points early. In particular I think that it is more important to be fast to explain what traits can do for you than to say what they are.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://510279]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.