NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Mixing two concepts (Score:2)
The example they give is difficult for me to follow. How would this be handled in Class::Trait, and under what circumstances would you need it?
Re:Mixing two concepts (Score:2)
Which paper are you referring to? Do you mean the Scharli paper "Traits: Composable Units of Behavior"? There's no reference to interfaces there so I'm not sure if this is the paper you mean. As a guess, are you asking why composed traits might have unsatisfied method requirements which the class using the composed traits must provide? I can answer that pretty easily, but don't want to spend a lot of time getting into that if it's the wrong question :)
Reply to This
Parent
Re:Mixing two concepts (Score:2)
Re:Mixing two concepts (Score:2)
OK, that's what I thought you meant, but I wasn't sure.
The reason for this requirement is straightforward. Let's say I create a "TSpouse" trait. That trait might provide companionship() and irritation() but still require love(). My class or some other trait has to supply that method. Having single, standalone traits require methods seems fine. For a real example, in my test code I have "XML" and "HTML" traits which require an "attributes" method. That method is provided by my "Data store" trait whic
Re:Mixing two concepts (Score:2)