Grails a Spring MVC Framework

Grails is based on the Model-View-Controller (MVC) architectural pattern and favors convention over configuration Grails framework build on top of Spring MVC. It uses URL to identify the action & view and process CRUD using domain. Business logic constitute in Grails services which could be wired with controller using Spring DI (Dependency Injection) mechanism.

Grails MVC

Grails Dispatcher servlet extends Spring Dispatcher Servlet which configured environment using grails configuration files located in conf folder. Grails Dispatcher servlet receive the request as URL and pass to SimpleGrailsController class. SimpleGrailsController will work as front controller which handler request and return the response to Dispatcher. SimpleGrailsController delegates request to SimpleGrailsControllerHelper that actually parse the request, identify the action. It executes action and  return ModelAndView which process by Grails controller and pass the response with UI back to the Grails Dispatcher

Grails Controller action invokes Grail service which intern uses Grails domain to execute the business functionality. GORM provides mapping mechanism between domain and database table. View uses SiteMesh as decorative framework  for consistent look/feel



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s