Tuesday, December 6, 2016

What is making Grails a good choice

What is making Grails a good choice from the multitude of frameworks for building Web applications
  • Grails is a full stack web framework in the sense that you can create an entire application using it. It covers the web presentation, business domain and database persistence aspects of your application. Not alone, but integrating the right technologies for this: Java, Spring, Hibernate. And all of this are linked by Groovy language with is used for configuring your application - the DSL for configurations are Groovy based (now in Grails 3 you will have the option to use YAML also)
  • conventions over configurations
    • for creating a service is enough to place a groovy file containing a class without state in /service folder without annotating it with @Service or mark it in a configuration file like in Spring or annotate with @Stateless for an EJB 3 stateless session bean
    • for creating an entity is enough to place a POJO class in a /domain folder and no @Entity annotation like in JPA or Hibernate or declaring it in configuration files
  • scaffolding for generating a seed application or a variety of elements starting from domain objects; it can be static (generating the corresponding files in the filesystem) or dynamic (generating just proxies in memory)
  • environments inside from beginning like TEST, DEV, PROD (or a custom one) letting you to take different actions in runtime based on the given environment
  • testing inside the framework (unit - in isolation using mocking, integration, functional) using JUnitSpock and Geb
  • static resources served in an optimized way (asset pipeline plugin replacing resources plugin)
  • asynchronous features based on plugins in first versions and directly inside in version 3 using Reactor
  • dynamic reload of classes and resources in runtime based on spring-loaded technology; no server restarts are needed in development or products like JRebel
  • and many more…

3 comments:

  1. I've bought this book and so far I like it very much. One thing though, in the instructions to set up one's development environment Netbeans is not mentioned. Netbeans is free and has excellent Grails support. I have used it in numerous projects. Here is the Netbeans page: https://netbeans.org/features/index.html You can install numerous plug-ins, among them the Groovy and Grails ones.

    ReplyDelete
  2. Hi Chris! Thank you for your comment.

    I am an Eclipse and Idea developer - I used Netbeans jut for generating some JPA entities from a database in the past (it has better support for this at that time). I see that there is support for Grails 2 with this plugin https://netbeans.org/kb/docs/web/grails-quickstart.html but not for Grails 3. See this threads: http://stackoverflow.com/questions/29441503/grails-3-0-support-in-netbeans

    Did you managed to work with Grails 3 in Netbeans? There is another plugin for this?

    ReplyDelete
  3. Hi Chris,

    Thank you again for your message. I will test Netbeans and I will write in my book about this.

    You can use https://leanpub.com/grails3book/feedback for comments about the book - is better than the blog.
    You can email me directly here: https://leanpub.com/grails3book/email_author/new
    I will add these links to the book presentation site.

    Thank you!

    ReplyDelete