Grails 3.0 and top 8 updates

15
www.tothenew.com

Transcript of Grails 3.0 and top 8 updates

www.tothenew.com

www.tothenew.com

Grails 3.0

www.tothenew.com

Agenda

A brief history of Grails Top 8 Updates in Grails 3.0

Source - [WHITEPAPER] Grails 3.0- What's New?

www.tothenew.com

A Brief History of Grails

A open-source web app framework

that reduces repetitive and

cumbersome tasks in development

Started as Groovy on Rails, it

was intended to be a high

productivity web framework for

Java platform

A spring-hibernate-sitemesh

wrapper has transformed into

a RAD framework supporting

various application profiles

On April 9, 2015, Object Computing

Inc. (OCI) became the home for

Grails framework

Grails framework has evolved through time

with multiple versions and Grails 3.0 is the

latest with many exciting features making

web development a lot easier

www.tothenew.com

Top 8 Updates in Grails 3.0

Spring boot under

the hood

Gradle as de-facto

build tool

Application Profiles

Configuration of

Plug-in lifecycle events

Traits to add dynamic

behavior

Project structure

changes

Application

configuration

Spring way of

request interception

www.tothenew.com

1. Spring Boot under the Hood

Create spring-powdered, production ready applications and services

Reduces ramp-up time for projects by eliminating boilerplate codes

and lengthy configurations

Grails has been completely re-written under the hood using

Spring Boot as its delivery vehicle

This offers a plenty of options that can be associated with Spring based

applications including Actuator integration, Fat JAR’s, Starter POMs, Spring 4.1

Source - [WHITEPAPER] Grails 3.0- What's New?

www.tothenew.com

2. Gradle as De-facto Build Tool

The learning curve for using Gradle to create Grails 3.0 applications

is negligible as the DSL used for adding dependencies, repositories is

almost similar to BuildConfig.groovy, which in-turn has been

removed completely from Grails 3.0

Gradle is now the native build system for Grails 3.0

and not just another plug-in

Source - [WHITEPAPER] Grails 3.0- What's New?

www.tothenew.com

3. Application Profiles

‘Profiles’ is a new feature of Grails (and is completely different

concept compared to Spring Boot profiles) that allows you to move away

from the traditional boundaries of web-apps and WAR files to building

standalone runnable JARs and micro-web applications

Source - [WHITEPAPER] Grails 3.0- What's New?

www.tothenew.com

4. Plug-ins’ Life-cycle Events

The main class Application.groovy extends GrailsAutoConfiguration class

which in turn implements GrailsApplicationLifeCycle interface and provides

default implementation for the life cycle event methods such as doWithSpring,

doWithDynamicMethods, doWithApplicationContext, onConfigChange,

onStartup and onShutdown. These methods were available to Plugins only

in earlier versions of Grails.

Source - [WHITEPAPER] Grails 3.0- What's New?

www.tothenew.com

5. Traits to Add Dynamic Behavior

The core API has been rewritten using groovy traits feature.

The good thing with traits is that these are compatible with static

Compilation and thus there is no runtime overhead when using it

Source - [WHITEPAPER] Grails 3.0- What's New?

www.tothenew.com

6. Project Structure Changes

Locations for Java/Groovy sources are moved to src/main directory

(maven style of source file structure) instead of placing them directly

in src folder.

Unit/Integration test class locations have also been changed

and moved to src folder. Static assets can be placed in src/main/webapp

folder.

However, the recommended way is to place the static assets in

src/main/resources/public folder as they will be packaged even if you

create JAR file instead of a WAR file.

UrlMappings.groovy and BootStrap.groovy have been moved to

new locations: grails-app/controller and grails-app/init respectively.

Source - [WHITEPAPER] Grails 3.0- What's New?

www.tothenew.com

7. Application Configuration

Inspired by Spring Boot the default config file now is application. yml.

YAML is a superset of JSON and is platform independent.

You can use application.groovy file to serve the same purpose

as Config.groovy has been doing

Datasource.groovy file for specifying database settings is completely

removed and settings is moved to application.yml/application.groovy

The logging configuration has been moved to separate file:

grails-app/conf/logback.groovy or grails-app/conf/logback.xml.

Logback is the default logging framework used by Grails 3.0.

Source - [WHITEPAPER] Grails 3.0- What's New?

www.tothenew.com

8. Spring Way of Request Interception

Grails 2.x style filters are deprecated in Grails 3.x

Grails 3.x has introduced a new artefact: Interceptor which implements

Interceptor traits

Leverage the power of CompileStatic annotation in interceptors for optimized

performance as interceptor/filters are invoked for every request

Unlike Filter artefacts, Interceptors are placed in grails-app/controller folder

Source - [WHITEPAPER] Grails 3.0- What's New?

www.tothenew.com

[Whitepaper] Grails 3.0 – What’s New?

Want to know more in detail about the latest upgrades in Grails 3.0 and

Upgradation of your existing plug-ins?

Download Whitepaper

www.tothenew.com

Contact us

Our Office

Client Location

Here’s how TOTHENEWseamlessly migrates an

application to GRAILS and

keeps it updated for your customers.

Click Here To Know More!

Have more queries on Grails?

Talk to our GRAILS experts

Now!

Talk To Our Experts