...or you could use AspectJ and get stateful & stateless mixins (via "introductions").
On Mon, Jan 23, 2012 at 11:14 PM, David Holmes <[email protected]>wrote: > On 24/01/2012 9:47 AM, Behrang Saeedzadeh wrote: > >> What's the general consensus regarding supporting mixins in Java 8 (or 9, >> etc.)? The more I use them, the more I like them. I especially like them >> for organizing code -- different categories of responsibility for a class >> are encapsulated in different mixins, for example: >> >> public class AccountManagement { >> mixin Authentication; >> mixin Authorization; >> mixin Administration; >> } >> > > You can get (some of?) the effects of stateless mixins/traits using the > proposed Default Methods [1] coming in with Project Lambda. Given the lack > of any active projects to do anything more than this, this would seem to be > the most you could expect to get in Java 8. > > For Java 9+ ... work with an OpenJDK Committer to write up a JEP [2]. > > Cheers, > David Holmes > > [1] http://cr.openjdk.java.net/~**briangoetz/lambda/Defender%** > 20Methods%20v4.pdf<http://cr.openjdk.java.net/~briangoetz/lambda/Defender%20Methods%20v4.pdf> > [2] http://openjdk.java.net/jeps/0 > > > Cheers, >> Behrang Saeedzadeh >> http://www.behrang.org >> > -- @matthewadams12 mailto:[email protected] skype:matthewadams12 yahoo:matthewadams aol:matthewadams12 google-talk:[email protected] msn:[email protected] http://matthewadams.me http://www.linkedin.com/in/matthewadams
