Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Spreading logic across our controller actions is all well and good. It’s pretty easy to track down what goes where in our small app, and maintenance isn’t a concern right now. But as our quotation app grows, we’ll find that things get a little more complex. We’ll want to reuse logic in different controller actions, and even across controllers. It’s time to tidy up our business logic, and the best way to do that in Grails is via a service.
Let’s create our service and learn by doing: