Sunday, February 11, 2007

Groovy adoption begins

After virtually being in the Groovy and Grails world for a couple of months - that is reading GINA and Definitive guide to Grails books and just playing around with Grails, I finally decided to start slowly introducing this wonderful language and framework at work.

So I decided to "just do it". The first opportunity came as there is a need to rewrite a simple CRUD type of an application written in Oracle forms (BTW, this app is used by one person only one time a year) That would be the typical Spring stack app. At first one might think that it would be a perfect candidate for Grails, but then several factors decided against it: the db schema is so messed up that even "raw" Hibernate mapping would not be able to help (it doesn't have any PK for instance; tables are terribly denormalized... agrrr); and also I decided to wait until Grails matures a little, so I would have easier times of pushing it through our "red tape".

So I've just introduced a simple helper written in Groovy, using groovy.Sql to do a simple DB update. Then injected that Groovy implementation into a "raw" java DAO using Spring 2.0 dynamic language support. I'll tell you one thing - the clarity of the code is even better than using JdbcTemplate (Oops.. did I actually say it) :-)

Next step is to rewrite the SimpleFormControllers in Groovy to reduce the amount of code in half.

And then fully rewrite one of our simpler Spring apps (namely netid query) in Grails (shhh... don't tell anyone...I've already done it... When the time is right I'll introduce it to our crowd at work)

Later...

1 comments:

Cai Hai Bin said...

Hope you could introduce your work to us also. =)