Grails: Services VS Groovy classes

Posted by Olexandr on Stack Overflow See other posts from Stack Overflow or by Olexandr
Published on 2010-04-01T10:06:41Z Indexed on 2010/04/01 10:13 UTC
Read the original article Hit count: 327

Documentation says:

The Grails team discourages the embedding of core application logic inside controllers, as it does not promote re-use and a clean separation of concerns.

I have one API controller and a few Groovy classes in src/groovy folder. Those classes just implements my application logic so actions in API controller works in this way:

//index page
def index = {
    render new IndexApi().index(params) as JSON
}

I'm curious - is there any reason to move my application logic from plain groovy classes into services ?

© Stack Overflow or respective owner

Related posts about Services

Related posts about grails