Reputation: 41
Could anyone please give some examples of possible service. I am going through the book, but cannot understand what can the service do? It provides processed data for modelAndView to controller, but what it looks like is it java bean connecting and retrieving results from database, what can it be?
Upvotes: 4
Views: 5742
Reputation: 120881
An example of an Service could be an Email Service in an Business Application (not in an Email-Client). This Service offer other Components the functionality (service) to send emails to notify users about stuff.
Upvotes: 0
Reputation: 34179
A service component is where all your DAOs come together and have the business logic. You can think of it this way.
Example:
Finally, I'd like to quote the grails doc for a clean concise quote.
As well as the Web layer, Grails defines the notion of a service layer. 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.
Upvotes: 14