Tuesday, December 8, 2009

Overriding Domain Class Getters and Setters in Grails

One might assume that it is possible to override getters and setters in the following manner:


def setName(String name){
//do stuff
}
def getName(){
//do stuff
return name
}


but infact static typing is required

public void setName(String name){
//do stuff
}

public String getName(){
//do stuff
return name
}

No comments:

Post a Comment