-
Book Overview & Buying
-
Table Of Contents
Grails 1.1 Web Application Development
By :
In the last two chapters, we allowed our users to post new files while using the application and also keep a version history of files. Unfortunately, as a result of these changes, we have accrued a certain amount of technical debt in the FileController class. This class is no longer handling just the flow of the application, but it is now responsible for managing the logic to enable the version history for files. We need to remove this logic from the controller, so that it can get back to controlling the flow of our application.
Grails supports a service layer that allows us to extract the logic of our application from controllers into reusable and testable services. This means that controllers can focus on controlling the application flow, rather than becoming cluttered with business logic.
Service classes are defined by another convention:
They must exist under the grails-app/services folder.
The class name must end in Service.
As with controllers and...
Change the font size
Change margin width
Change background colour