Developing an application that can run from anywhere, anytime is simply amazing. For web application development, Java platform brings more power. Java API and its plethora of frameworks & libraries make it feasible to include almost any feature one would want in a web application.
With most Java-based web frameworks, there are multiple XML configuration files to deal with, along with classes to extend and interfaces to implement, an agonizing build system where testing a single change takes minutes instead of seconds. As the project grows, this complexity seems to increase exponentially. Many web application frameworks have been created to address this problem.
Why Grails Framework
Grails removes all the barriers and exposes the users to APIs that enable them to focus purely on the business problem at hand. With this framework there is no configuration, zero overhead, immediate turnaround.
Grails offers don’t repeat yourself (DRY), convention over configuration (CoC) and sensible defaults that are enabled through the Groovy language and a structured variety of domain-specific languages (DSLs) that make life easier.
Grails makes developing apps simple, easy to use and more powerful by integrating successful frameworks which themselves address the complexity of building web applications.
Grails wraps the frameworks by introducing another layer of abstraction via the Groovy language. Developer will not know that he is building a Spring and Hibernate application. Certainly, developers won’t need to touch a single line of Hibernate or Spring XML.
Grails Stack
It majorly consists of
- Hibernate: The de facto standard for object-relational mapping (ORM) in the Java world.
- Spring: The hugely popular open source Inversion of Control (IoC) container and wrapper framework for Java.
- SiteMesh: A robust and stable layout-rendering framework.
- Tomcat: A proven, embeddable servlet container.
- H2: A pure Java Relational Database Management System (RDBMS) implementation.
ORM helps in mapping out objects onto tables in a relational database from object-oriented world. It also allows developers to think about their domain model instead of getting wrapped up in reams of SQL.
IoC makes objects available at runtime by wiring them together. As an example, an object that performs persistence might require access to a data source. IoC relieves the developer of the responsibility of obtaining a reference to the data source.
Grails is a fully compliant JavaEE framework. Groovy and Grails is not here to take over Java. Infact, the role of groovy is to simplify tasks that are tedious in Java. Developers can extend the functionality of Grails with numerous plugins, and easily dip into the underlying technologies to achieve what is needed.