Mixins vs composition in scala
A lot of the problems that people have with mix-ins can be averted in Scala if you only mix-in abstract traits into your class definitions, and then mix in the corresponding concrete traits at object instantiation time. For instance trait Locking{ // abstract locking trait, many possible definitions protected def lock(body: =>A):A } class MyService{ … Read more