Discussion:
Groovy Traits in Grails
Aaron Long
2014-04-23 17:02:06 UTC
Permalink
The more I read about traits, the more I'm excited about using them into
our applications. Currently, we are using mixins to achieve some of the
same functionality, although it's a bit clunkier for some use cases.

I was wondering if there are plans to start incorporating or refactoring
any areas of grails-core to use traits? It seems like many of the behaviors
that are applied to domains, services, etc. might be better expressed as
traits that could be implemented as needed.

For work being contributed to 2.4 and beyond, is the use of Traits ok where
applicable? (obviously golden hammers aside).

-Aaron
Graeme Rocher
2014-04-24 10:37:42 UTC
Permalink
So yeah 2.4 will include Groovy 2.3 so using Traits is fine if 2.4 is
a requirement

There are definitively areas (text mixins come to mind) that could be
refactored / improved so they are expressed as traits. Something to
consider when we do Grails 3.0

Cheers
The more I read about traits, the more I'm excited about using them into our
applications. Currently, we are using mixins to achieve some of the same
functionality, although it's a bit clunkier for some use cases.
I was wondering if there are plans to start incorporating or refactoring any
areas of grails-core to use traits? It seems like many of the behaviors that
are applied to domains, services, etc. might be better expressed as traits
that could be implemented as needed.
For work being contributed to 2.4 and beyond, is the use of Traits ok where
applicable? (obviously golden hammers aside).
-Aaron
--
Graeme Rocher
Grails Project Lead
SpringSource

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Loading...