1 Introduction
Version: 3.3.0.M2
Table of Contents
1 Introduction
Java web development as it stands today is dramatically more complicated than it needs to be. Most modern web frameworks in the Java space are over complicated and don’t embrace the Don’t Repeat Yourself (DRY) principles.
Dynamic frameworks like Rails, Django and TurboGears helped pave the way to a more modern way of thinking about web applications. Grails builds on these concepts and dramatically reduces the complexity of building web applications on the Java platform. What makes it different, however, is that it does so by building on already established Java technologies like Spring and Hibernate.
Grails is a full stack framework and attempts to solve as many pieces of the web development puzzle through the core technology and its associated plugins. Included out the box are things like:
-
An easy to use Object Relational Mapping (ORM) layer built on Hibernate
-
An expressive view technology called Groovy Server Pages (GSP)
-
A controller layer built on Spring MVC
-
An interactive command line environment and build system based on Gradle
-
An embedded Tomcat container which is configured for on the fly reloading
-
Dependency injection with the inbuilt Spring container
-
Support for internationalization (i18n) built on Spring’s core MessageSource concept
-
A transactional service layer built on Spring’s transaction abstraction
All of these are made easy to use through the power of the Groovy language and the extensive use of Domain Specific Languages (DSLs)
This documentation will take you through getting started with Grails and building web applications with the Grails framework.
1.1 What's new in Grails 3.3?
This section covers all the new features introduced in Grails 3.3.
1.1.1 GORM 6.1
Grails 3.3 comes with GORM 6.1, which includes the following new features:
-
Multi-Tenancy AST Transforms
-
Rewritten
@Transactional
and@Rollback
transformations -
Common Services like
TenantService
andTransactionService
-
Data Services Concept - Implement interfaces automatically!
-
Bean Validation API Support
-
JPA Annotation Support
-
Package Scanning and Easy Unit Testing
-
Neo4j Bolt 1.2 Driver Support
-
MongoDB 3.4 Driver Support
There are so many new features and novelties in GORM that we had to write its own independent What’s New Guide!
1.1.2 New Events API
The Grails Async Framework has been extracted from Grails and moved to a separate project.
This allows the Async support to evolve independent of the framework itself in a fast moving and evolving area.
In order to support multiple different asynchronous and reactive frameworks Grails 3.3 has been decoupled from Reactor 2.x and an abstract EventBus
notation added.
The EventBus interface provides the foundation and multiple implementations including GPars and RxJava.
A new set of annotations usable in services classes and regular Spring beans can be leveraged to publish and consume events:
-
Publisher - A transformation that transforms a method ensuring the return value is published as an event
-
Subscriber - A transformation that transforms a method to listen for an event.
For more information see the new documentation.
1.1.3 JSON Views 1.2
Version 1.2 of the JSON Views plugin is included with Grails 3.3’s "rest-api" profile and includes a number of new features. Below are some of the highlights:
-
Support for the JSON API specification
-
Ability to register custom converters
-
Multiple configuration options for date formatting, unicode escaping, etc
1.1.4 Updated Dependencies
Grails 3.3 ships with the following dependency upgrades:
-
Hibernate 5.1.5 (now the default version of Hibernate for new applications)
-
Spring Framework 4.3.7
-
Spring Boot 1.5.3
-
Gradle 3.5
-
Spock 1.1