Grails 3 and grails.validateable.classes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Grails 3 and grails.validateable.classes

Jeff Scott Brown-3
For Grails 3 I have been surveying a lot of the places where Grails does runtime metaprogramming and have been replacing a lot of that with compile time work or use of Groovy’s extension api support.  One situation we have is the way we support grails.validateable.classes.  Grails allows you to do something like this in Config.groovy:

grails.validateable.classes = [com.mycompany.myapp.User, com.mycompany.dto.Account]

Those classes are made validateable using runtime metaprogramming.  I think the primary reason for taking advantage of that is if those classes are included in some library and you can’t mark them with @Validateable.  I expect that feature is not very widely used. I think we should remove the code from Grails 3 which supports that.  A plugin which adds that support back to the app would be trivial to build but I think it is a small bit of cruft in core that probably isn’t justified.

Thoughts?



JSB

--  
Jeff Scott Brown  
[hidden email]

Find The Cause ~ Find The Cure  
http://www.autismspeaks.org/

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/etPan.53e4e50a.6b8b4567.14bcd%40JSB-MBP-August-2012.local.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Grails 3 and grails.validateable.classes

eduardo
This post has NOT been accepted by the mailing list yet.
Hi Jeff,

I do thing that removing all the runtime magic would be beneficial for Grails, if people still need those functionality as you said it can be done adding it back as a plugin if necessary.

Is there any roadmap place where we can play test grails 3 ? do you guys have an alpha branch or sth ?

Regards,
Eduardo
Reply | Threaded
Open this post in threaded view
|

Re: Grails 3 and grails.validateable.classes

pledbrook
In reply to this post by Jeff Scott Brown-3
On 8 August 2014 15:56, Jeff Scott Brown <[hidden email]> wrote:
> For Grails 3 I have been surveying a lot of the places where Grails does runtime metaprogramming and have been replacing a lot of that with compile time work or use of Groovy’s extension api support.  One situation we have is the way we support grails.validateable.classes.  Grails allows you to do something like this in Config.groovy:
>
> grails.validateable.classes = [com.mycompany.myapp.User, com.mycompany.dto.Account]
>
> Those classes are made validateable using runtime metaprogramming.  I think the primary reason for taking advantage of that is if those classes are included in some library and you can’t mark them with @Validateable.  I expect that feature is not very widely used. I think we should remove the code from Grails 3 which supports that.  A plugin which adds that support back to the app would be trivial to build but I think it is a small bit of cruft in core that probably isn’t justified.
>
> Thoughts?

Do it. I think consistency of behaviour is best here. That said, it
would be useful if developers have some way of making classes outside
of their control validateable, even if it requires some work on their
part. I wonder if the @Delegate annotation is a viable option here.

Peter

--
Peter Ledbrook
t: @pledbrook
w: http://www.cacoethes.co.uk/

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CANBeYQSOCCZbtrZKThG6tcCLusat%2B3TorRabM02D1UpvHqNdkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.