On Wed, Apr 9, 2008 at 1:24 PM, Jochen Theodorou <
blackdrag@...> wrote:
> Alexandru Popescu ☀ schrieb:
>
>
> > On Wed, Apr 9, 2008 at 11:55 AM, Graeme Rocher <
graeme@...> wrote:
> >
> > > Traits and mixins are different concepts, one is compile time the
> > > other is dynamic and runtime.
> > >
> > > This still needs to be implemented for mixins, but trait supported
> > > would be cool none the less :-)
> > >
> > > Cheers
> > >
> > >
> > >
> >
> > I may be a bit late to the party and my comments my sound a bit
> > negative, so I'll apologize for them upfront. I have passed through
> > this thread (and the older one) and here are my observations:
> >
> > 1/ this looks like an enhanced DGM mechanism under a new name. I do
> > think that allowing enhancing DGM (by additions/overloading etc) is a
> > powerful feature Groovy should support I don't think a new name should
> > be introduce for that.
> >
>
> but neither DGM nor categories are good names for that.
>
>
>
> > 2/ traits and mixins are 2 similar but different concepts. Traits are
> > affecting the stateless functionality, while mixins are able to
> > enhance functionality by bringing state. Also, both concepts (at least
> > in theory) are influencing the hierarchy chain. Both mechanism are
> > usually applied at runtime (indeed they can also be applied at
> > "compile" time but this is less powerful). As I presented in an older
> > post, as long as instanceof and Class.isAssignableFrom cannot be
> > overwriten then it will be quite difficult to support runtime
> > traits/mixins
> >
>
> can you please again give an example? I can't remember why this is needed
> for traits/mixins
>
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).
> bye blackdrag
>
> --
> Jochen "blackdrag" Theodorou
> The Groovy Project Tech Lead (
http://groovy.codehaus.org)
>
http://blackdragsview.blogspot.com/>
>