Mixin or Trait implementation in AS3?

Posted by Brian Heylin on Stack Overflow See other posts from Stack Overflow or by Brian Heylin
Published on 2010-04-05T08:50:50Z Indexed on 2010/04/05 8:53 UTC
Read the original article Hit count: 412

Filed under:
|
|

I'm looking for ideas on how to implement a Mixin/Trait style system in AS3.

I want to be able to compose a number of classes together into a single object. Of course this is not a language level feature of AS3, but I'm hoping that there is maybe some way to do this using prototype based techniques or maybe some bytecode hacking that I believe AsMock uses to implement it's functionality.

An existing Java example is Qi4J where the user define interfaces that the Qi4j framework implements based on metadata tags and coding by convention.

Has anyone any ideas on how to get the Mixin/Trait concept working within AS3?

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about mixin