Thursday, March 11, 2010

Grails Productivity Tip: Depend on Your Plugin

Tagged with: , , ,
Wednesday, April 15, 2009, 8:00
This news item was posted in HowTo & Tutorial, Programming category and has 1 Comment so far.
Grails
Image via Wikipedia

Grails has amazing plugin infrastructure. In short it enables almost everything the core application can do and has really good  list of plugins: http://grails.org/Plugins

Here what I want to say is something a little bit different:

Do all your business in your application plugin

Reminder: Plugins are enabled in Grails

You can reuse all implementation in your plugins:

  • Model Object
  • Services
  • Controllers
  • Gsp pages

Plugins can define their plugin dependency, just like maven dependency.

Goal: Extreme Modularity

Model all your business in a single plugin.

You can consider grails an application container in this case which manages transactions and persistence, and ui and enable each plugin with all customization.  What you need to do is using config. groovy and ConfigurationHolder for configuration issues.

What grails will do is just starting up plugins and and the applications one by one and expose all services, domain class and controllers which will work fine.

It will increase your modularity and ease your integration issues. You can also run your plugins while your are developing them. This is the most amazing part of all the scenario. You do not need to enter pack-install cycle to test anything.

Tough Part: IDE

If you have already established something like this before with Java you would have setup your IDE for this kind of integration. But for grails there is not support as far as far as I know :( So be ready run some console commands:

cd mycore

grails package-plugin

cd ../myapp

grails install-plugin ../mycore/grails-mycore-plugin-0.1.zip

Reference Guide:

http://www.grails.org/The+Plug-in+Developers+Guide

Reblog this post [with Zemanta]
Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • Wists
  • LinkedIn
  • Slashdot
  • Google Bookmarks
  • Reddit
  • StumbleUpon
  • email
  • Twitter

Related posts:

  1. Grails, First Impressions
  2. Grails Days 1: GORM-CRUD
  3. all-in-one Software House
  4. Grails 101:GroovyBlogs.org
  5. Is Grails too much Groovy ?

You can leave a response, or trackback from your own site.

One Response to “Grails Productivity Tip: Depend on Your Plugin”

  1. Ceren said on Wednesday, April 15, 2009, 22:10

    Using dependency is a nice idea but seperating the config files like SecurityConfig would be better.

Leave a Reply