Everything’s Groovy
One of the major benefits of using Grails as a web platform is how almost everything can be written in a single language — Groovy. No more switching gears between language constructs. Everything’s Groovy.
Groovy is most definitely the star of the Grails show. Every decision that went into formulating Grails started with, “What’s the Groovy take on this? How can we best take advantage of the innate ability of Groovy to solve this?” This attitude makes for a framework that’s powerful, yet minimal and consistent.
This attitude also goes beyond the Web framework. Groovy can be used end-to-end from inside the web server pages to the outer build scripts and even your shell scripts. In the Java world, before Grails came along, one would have to work in seven different languages to build a web app. Grails potentially reduces that to three:
| Aspect |
Any other Java Web Framework (e.g. JSP/Struts) | Grails Way |
|---|---|---|
| Business Logic | Java | Groovy |
| Web Pages | An arbitrary expression language such as EL or OGNL | Groovy |
| Data Access | Hibernate HQL, SQL, or Java | Groovy (GORM) |
| Client-Side Scripting | JavaScript | JavaScript |
| Style Sheets | CSS | CSS |
| Build Scripts | XML (Ant) | Groovy (GANT) |
| Shell Scripts | Linux bash scripts or Windows batch files | Groovy (shebang) |
Tags: Grails, Groovy, web frameworks
