Mixins in ActionScript
09 Nov 2004During discussion with friends, colleagues and community, I have realized that 'Mixins' has been a topic of confusion and many people are not aware of. This might be because 'Mixins' concept is not intuitive in Object Oriented Programming and it also violates the principals of OOP. But sometimes a little violation can make our life simpler, Mixins concept let you do multiple inheritance someway even though multiple inheritance is not supported in the language.
'Mixins' are classes which are not used directly, rather we mix the properties and methods of these classes into other classes using language specific techniques. This allows a class having behaviours from different classe, much like multiple inheritance. ActionScript being a dynamic and prototype based language, this becomes more easier and useful. The very first 'Mixins' class I ever used, was ASBroadcaster, which is still undocumented class(object).
I tried my way to explain it but I guess, I have bookmarked an article which gives the better insight of this topic. This article is easy to understand and is in context of ActionScript , Macromedia V2 component architecture and Flex.
Article Link: http://www.macromedia.com/support/documentation/en/flex/1/mixin/index.html