Grails 3.0 is Next gen Grails

Posted By : Oodles Admin | 24-Apr-2015

Grails-3.0 is the latest version over 2.x. Grails-3.0 takes up the library approach and works on principle of no more code generation.

In Grails 3.0, the framework have its significant parts rewritten, it is completely based on Spring Boot, “Gradle” as its build system is used rather than “Gant” which was used in previous version.

 

Grails came out really good and worked very well on things which really didn't work in earlier versions. Its pretty a rewrite over the top of Spring Boots. Lots of idea were pulled into spring boots. It means that Grails 3 don't need to maintain more features, as it will be maintained under Spring Boot which gives grail a lot more freedom to try things apart from framework. Most of the plugin have been migrated from 2x to 3x. Some of the plugin can't be migrated due to their functionality while some are put out - as a matter of time, won't be valid any more, some might not be maintained any more. Main core plugins like Spring Security plugin have been imported over while commodity plugin might take time. In Grail 3, Anomaly is quite different and is slightly different as the conventions are pulled over from spring boot. The Configurations used in Grails 3 are quite different (Much quicker and weighted) but can use previous configuration.

 

 

Now Build.gradle and gradle.properties contain the build configuration, the BuildConfig.groovy (used in previous Grails versions) has been removed.

To meet Gradle Conventions, the structure of the src folder has been changed and the additional Java, Groovy files are now located in:

src/main/java

src/main/groovy

src/test/java

src/test/groovy

 

Interceptors

The standalone Interceptors has been introduced in Grails 3. Interceptors, intercept incoming requests to perform common tasks like logging, authentication, etc .

To add new Interceptor the create-interceptor command is used:

grails create-interceptor MyInterceptor

 

Filter ( used in previous Grails) has been replaced by Interceptors but Filters still work in Grails 3 for backwards compatibility.

 

Traits

The best part is that you can add traits to your own classes. In Grails 3, the features like  Controllers and Domain classes ( used in previous version) has now been replaced to make use of Traits ( known in Groovy 2.3)

Some of the traits are automatically attached to Controllers, Services, Tag libraries and so on to make framework methods available.


Thanks!

 

About Author

Author Image
Oodles Admin

Divya has more than 6 years of industrial experience in different domains – SAP EP, Search Quality Operations and Content Writing. She loves travelling across the world and also enjoys watching movies.

Request for Proposal

Name is required

Comment is required

Sending message..