Multiple dynamic method calls or declaring a variable in Grails
Posted
by user303979
on Stack Overflow
See other posts from Stack Overflow
or by user303979
Published on 2010-04-06T03:15:57Z
Indexed on
2010/04/06
3:23 UTC
Read the original article
Hit count: 265
grails
In my view, if I have a situation where I need to use a dynamic method (such as Domain.findByName("name")) in multiple places, would it be better to define a variable with and refer to that, rather than have the dynamic method in multiple places? I know this seems like an obvious answer, but I just wanted to make sure Grails doesn't cache it or something, and indeed two DB calls are being made.
© Stack Overflow or respective owner