Created
November 29, 2012 14:21
-
-
Save boyzoid/4169411 to your computer and use it in GitHub Desktop.
Grails Service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public list(){ | |
Layout.executeQuery('from Layout where user is null') | |
} | |
public list( User user ){ | |
Layout.executeQuery('from Layout where user = :user or user is null', [ user: user ]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not sure I agree that overloading methods would 'change the core nature of the language'. Make it possible to do so, but not mandatory. Problem solved.
I disagree that dynamic argument styles are more elegant and is more elegant. Method overloading may result in more methods (more lines of code), but each method would, in my opinion, more elegant that the uber-method you would need to handle this with dynamic/optional arguments.