On Wed, Apr 9, 2008 at 12:10 PM, Jochen Theodorou <
blackdrag@...> wrote:
> Alexandru Popescu ☀ schrieb:
> [...]
>
>
> > Both mixins and traits are becoming part of the hierarchy chain, so I
> > think this may be the only way to achieve it when mixins/traits are
> > applied dynamically at runtime (indeed in case we are interested in
> > the full theoretical concept).
> >
>
> Java itself has no real concept of multiple inheritance besides interfaces.
> Given that this comes not for free, may I ask what we need this for? I still
> do not see why this is really needed. Also the MetaClass could be asked
> directly for such things... it would be easy to add that (and breaking the
> interface again)
The only real feature of traits I see over mixins if we go with my
definition of mixins being runtime/non-hierarchy effecting and traits
being compile time/hierarchy effecting is that you get the features
of type inference that you see in Scala which will result in better
IDE support and easier integration on the Java side which doesn't see
dynamic methods.
However, whether we *need* traits is another issue. Mixins I'm
certainly up for and was one of the things I hoped to implement for
1.6, thankfully Alex has nearly done the job for me :-)
Cheers
--
Graeme Rocher
Grails Project Lead
G2One, Inc. Chief Technology Officer
http://www.g2one.com