Mixins vs. Traits
What is the difference between Mixins and Traits? According to Wikipedia , Ruby Modules are sort of like traits. How so? Mixins may contain state, (traditional) traits don't. Mixins use "implicit conflict resolution", traits use "explicit conflict resolution" Mixins depends on linearization, traits are flattened. Lecture about traits ad 1. In mixins you can define instance variables. Traits do not allow this. The state must be provided by composing class (=class using the traits) ad 2. There may be the name conflict. Two mixins ( MA and MB ) or traits ( TA and TB ) define method with the same