Skip to main content

2013 | Buch

The Definitive Guide to Grails 2

insite
SUCHEN

Über dieses Buch

Grails is a full stack framework which aims to greatly simplify the task of building serious web applications for the JVM. The concepts within Grails, like interceptors, tag libs, and Groovy Server Pages (GSP), make those in the Java community feel right at home.

Grails’ foundation is on solid open source technologies such as Spring, Hibernate, and SiteMesh, which gives it even more potential in the Java space: Spring provides powerful inversion of control and MVC, Hibernate brings a stable, mature object relational mapping technology with the ability to integrate with legacy systems, and SiteMesh handles flexible layout control and page decoration.

Grails complements these with additional features that take advantage of the coding–by–convention paradigm such as dynamic tag libraries, Grails object relational mapping, Groovy Server Pages, and scaffolding.

Graeme Rocher, Grails lead and founder, and Jeff Brown bring you completely up–to–date with their authoritative and fully comprehensive guide to the Grails 2 framework. You’ll get to know all the core features, services, and Grails extensions via plug–ins, and understand the roles that Groovy and Grails are playing in the changing Web.

Inhaltsverzeichnis

Frontmatter
Chapter 1. The Essence of Grails
Abstract
To understand Grails, you first need to understand its goal: to dramatically simplify enterprise Java web development. To take web development to the next level of abstraction. To tap into what has been accessible to developers on other platforms for years. To have all this while still retaining the flexibility to drop down into the underlying technologies and utilize their richness and maturity. Simply put, we Java developers want to “have our cake and eat it, too.”
Jeff Scott Brown, Graeme Rocher
Chapter 2. Getting Started with Grails
Abstract
In Chapter 1, you got your first introduction to the Grails framework and a feel for the basic command-line interface while creating the basis for the gTunes application. This chapter is going to build on that foundation by showing how you can use the Grails scaffolding feature to quickly build a prototype application that can generate simple CRUD (Create, Read, Update, Delete) interfaces.
Jeff Scott Brown, Graeme Rocher
Chapter 3. Understanding Domain Classes
Abstract
Object-oriented (OO) applications almost always involve a domain model representing the business entities that the application deals with. The gTunes application will include a number of domain classes, including Artist, Album, and Song. Each of these domain classes has properties associated with it. You must map those properties to a database in order to persist instances of those classes.
Jeff Scott Brown, Graeme Rocher
Chapter 4. Understanding Controllers
Abstract
A Grails controller is a class that is responsible for handling requests coming in to the application. The controller receives a request, potentially does some work with the request, and finally decides what should happen next. What happens next might include the following:
  • executing another controller action (possibly but not necessarily in the same controller)
  • rendering a view
  • rendering information directly to the response
Jeff Scott Brown, Graeme Rocher
Chapter 5. Understanding Views
Abstract
The topic of view technologies for web applications in the open source world appears to be rather popular, at least if the seemingly endless number of them available for Java is any indication. There always seems to be a newer, better one to learn if you grow tired of the incumbent JSP. JSP, however, remains the most popular view technology produced by Sun to compete with Microsoft’s Active Server Pages (ASP), JSP has become the industry standard, and there is a high level of developer knowledge surrounding JSP.
Jeff Scott Brown, Graeme Rocher
Chapter 6. Mapping URLs
Abstract
Grails provides working URL mappings right out of the box. The default URL mapping configuration is yet one more place that the Grails framework leverages the powerful idea of convention over configuration to lessen the burden put on the application developer. Sometimes, though, you will want to deviate from the convention and define your own custom mappings. For example, you may want to create more descriptive and human-readable URLs. Grails gives you the ability to easily define these custom URL mappings.
Jeff Scott Brown, Graeme Rocher
Chapter 7. Internationalization
Abstract
One of the great things about web applications is that they are really easy to distribute to a lot of people. When deploying web applications to a broad audience, often the applications need to adapt and behave differently under certain circumstances. For example, when a request from Spain is made to a web application, the application may want to display messages to the user in Spanish, but the same application will want to render messages in English if the request comes from New York. The adaptations made by the application may involve more complexity than simply displaying different versions of text. An application may need to impose different business rules based on the origin of a particular request.
Jeff Scott Brown, Graeme Rocher
Chapter 8. Ajax
Abstract
Ajax is a really important piece of the modern web application story. The technology was originally developed by Microsoft to power a web-based version of its Outlook e-mail software. Microsoft implemented Ajax as an ActiveX control that could be used by its browser, Internet Explorer, and be called from JavaScript to perform asynchronous browser requests.
Jeff Scott Brown, Graeme Rocher
Chapter 9. GORM
Abstract
As you may have garnered from this book’s table of contents, the persistence layer of Grails is a critical part of the picture. In Chapter 3 you were given a surface-level understanding of what domain classes are and how they map onto the underlying database. In this chapter you’ll plunge headfirst into the inner workings of GORM.
Jeff Scott Brown, Graeme Rocher
Chapter 10. Services
Abstract
A common pattern in the development of enterprise software is the so-called service layer that encapsulates a set of business operations. With Java web development, it is generally considered good practice to provide layers of abstraction and reduce coupling between the layers within an MVC application.
Jeff Scott Brown, Graeme Rocher
Chapter 11. Integration and Dependency Management
Abstract
So far, a number of the core concepts that underpin Grails have been explored. From controllers to GORM and services, you should now have a pretty good understanding of what makes Grails tick. In this chapter, you’ll learn how you can fit Grails into your existing ecosystem. We hope what you’ll get from this chapter is a good understanding of how to go about including Grails in your build system, development tools, reporting setup, and server environment.
Jeff Scott Brown, Graeme Rocher
Chapter 12. Plug-ins
Abstract
Up until now, you have been a consumer of the Grails plug-in system at various points throughout the book. Plug-ins are very much a cornerstone of Grails. Grails itself is basically a plug-in runtime with little knowledge beyond how to load and configure an installed set of plug-ins. Most of the core of Grails is implemented as a suite of plug-ins for this runtime.
Jeff Scott Brown, Graeme Rocher
Backmatter
Metadaten
Titel
The Definitive Guide to Grails 2
verfasst von
Jeff Scott Brown
Graeme Rocher
Copyright-Jahr
2013
Verlag
Apress
Electronic ISBN
978-1-4302-4378-6
Print ISBN
978-1-4302-4377-9
DOI
https://doi.org/10.1007/978-1-4302-4378-6

Premium Partner