(Quick Reference)

create-service

Purpose

The create-service command creates a Grails service class and associated unit test for the given base name.

Examples

grails create-service org.bookstore.book

Description

Creates a service for the give base name. For example for a base name org.bookstore.book a service called BookService will be created in the grails-app/services/org/bookstore directory.

A service class encapsulates business logic and is delegated to by controllers to perform the core logic of a Grails application. For more information on services refer to the section on Services in the user guide.

Note that this command is just for convenience and you can also create services in your favorite text editor or IDE if you choose.

Usage:

grails create-service [name]

Fired Events:

  • CreatedFile - When the service has been created