Part 2. Core Grails


In part 1, we gave you a whirlwind introduction to both the core parts of Grails and the underlying Groovy language that powers it. In part 2, we’ll start a more thorough exploration of the three core parts of the Grails ecosystem: models, controllers, and views.

In chapter 3, we’ll look at domain modeling—the heart of any Grails application. You’ll learn about saving and updating domain classes, explore the many facets of validation, and cover all basic relationships for domain classes (1:1, 1:m, m:n).

Chapter 4 will put your modeling skills to work by taking you through the numerous query mechanisms that Grails offers for searching your domain model. We’ll also investigate Grails’s fantastic scaffolding features, which allow you to build a functional UI in record time.

Chapter 5 introduces ways to query a database in Grails without using SQL. You’ll learn how to generate sample data and explore advanced querying techniques by building a basic search form for Hubbub that provides a basis for trying different types of query.

In chapter 6, you’ll be ready to explore some of the web-oriented features of Grails. In particular, how you can route a user around the different features in your application using Grails controllers. We’ll also cover binding data from web forms, writing a request filter, and even creating custom URL mappings to add user-friendly permalinks to your application.