Why should grails actions be declared as methods instead of closures and what difference does it make?

The answer is here

From above link

Leveraging methods instead of Closure properties has some advantages:

  1. Memory efficient
  2. Allow use of stateless controllers (singleton scope)
  3. You can override actions from subclasses and call the overridden superclass method with super.actionName()
  4. Methods can be intercepted with standard proxying mechanisms, something that is complicated to do with Closures since they’re fields.

Also there’s a similar groovy question here that has some more details

Leave a Comment