Vaadin 7 on Grails 2.x
  • Introduction
  • Project setup
    • Command Line
    • IntelliJ IDEA
    • Eclipse
    • NetBeans
    • Plugin Configuration
    • Clean up
    • Best Practices
  • Database
    • GORM
      • Create Domain Model
      • Transactions
      • LazyInitializationException
      • Open Session In View I.
      • Open Session In View II.
      • Table Container
    • Groovy SQL
      • Create Sql
      • Execute SQLs
    • MyBatis
      • Configuration
      • Basics
    • JdbcTemplate
      • Create Beans
      • Usage
    • Clean Up With Alternatives
  • Architecture
    • Model View Presenter
  • Spring Autowiring
    • Create Simple Application
    • Application With Navigator
  • UI
    • Re-using GORM Validations
    • Async Push
    • Multiple application
    • SASS Compilation
    • Widgetset Compilation
  • Spring Security
    • Spring Security Dependency
    • Spring Security Basics
    • Secured Navigator
  • Localization
    • Localization Basics
    • Custom MessageSource
  • REST
    • Without using root URL
    • Using root URL for Vaadin app
  • Plugin development
    • Github
    • Development
Powered by GitBook
On this page
  • Keep work with GORM in Services
  • CompileStatic
  • Types

Was this helpful?

  1. Project setup

Best Practices

Keep work with GORM in Services

Never work with GORM in Vaadin code, use services or any other layer, like DAO, to encapsulate work with database. It will keep your Vaadin and database code separated, which will make the application code more readable and maintainable.

CompileStatic

Use @CompileStatic annotation everywhere you can. The exception not to use the annotation is dynamic code where you need to utilize dynamic features of Grails, for example, to access variables that are not visible during compilation.

Types

Use def only when it is required, because it always good to know type of a variable. Together with @CompileStatic annotation, you will know about compilation errors during compilation, not during runtime.

PreviousClean upNextDatabase

Last updated 5 years ago

Was this helpful?