What are the best practices to be followed while developing a grails application?

devquora
devquora

Posted On: Feb 22, 2018

 

Building an application using grails framework is quite easy. But, when building it the right way we need to follow the best practices. Some of the practices followed while building a grails application are listed below:
  • Controller: the controller logic should be as simple as possible. Duplication of code should be avoided.
  • Service: it is the right choice for a coarse-grained code. By default, services are transactional in nature.
  • Views: views should be as simple as possible. A consistent look should be maintained throughout the pages of the application.
  • Internationalization: all the text messages in view should be moved to “messages.properties”.
  • Domain: the specific logic of the model domain should be placed in its own domain.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Java Grails Interview Questions

    What do you mean by scaffolding? How do we use it?

    Scaffolding is used to generate some basic CRUD interfaces for a domain class. It includes the necessary views and some..

    Java Grails Interview Questions

    What is the use of bootstrap.groovy?

    Sometimes a situation occurs in which a particular task is to be carried out every time the application starts or stops..

    Java Grails Interview Questions

    What do you mean by closures?

    A closure is a short and anonymous block of code which is just used to span a few lines of code. This block of code can..