in reply to Informal Poll: why aren't you using traits?
No you're not alone, i've never heard of traits either, and after reading most of the introduction, i'm still not sure i understand them.
Correct me if i'm wrong or point me in the right direction, but are traits just basically 'traits' of a class? From there then any other class can inherit these traits, allowing for multiple inheritance to or from any class? I can see how it's a little different than the normal methods. But specifically how does this differ that much from an 'abstract class' ? where multiple classes have all of the same methods that are inherited from one abstract class, thus that abstract class having multiple inheritance?
Forgive me if i'm just spouting nonsense, it's been a while since i've had to deal with terms like abstract, polymorphism and inheritance all in the same sentance. Definately seems interesting though and like someone put a lot of work into that paper. When i have more time i'll definately take a more in depth look
Update
Read a little further... it does cover abstract classes (in C++). Looks like traits tries to solve the duplication of methods and trying to avoid 'name clashes'.
Out of curiosity, has anyone ever used/heard the terms 'mixins' or 'glue methods' ? There seems to be a lot of terminology in this paper that i'm not familiar with
|
|---|