From what I can tell from Scala and Hack-
Mixins:
- Can have state (ie. instance properties)
- Can only provide concrete methods
- Can have constructors, that are called in the same order that their classes were mixed in
- If
A
mixes inB
andC
,A instanceof B == false
andA instanceof C == false
Traits:
- Can only provide methods, not state
- Can declare abstract methods, that a consumer must implement
- Cannot have constructors
- If
A
implements traitsB
andC
,A instanceof B == false
andA instanceof C == false
Is this correct or am I missing anything ? Are these definitions accurate for any OO language or just for the above mentioned ones ?