What is Grails. Why should a Spring developer use it?

When I first heard about Grails, I thought Rails finally visit Java. I like Groovy, as it is quite easy for me to pick up and an framework based on it will be fun. That’s what I thought. Does things look good? Will it worth your time to shift? Let’s see.

I never really had a chance to use Grails up until last year, for my pet project. Which I longingly desired to change it from very old Spring version to something new. It was done around 2008, without any annotations.

First thing you easily notice is, when you start with Grails, you get excited. Yes, configuration is none. Which as a Spring developer, I find a good one. Next, scaffolding. I had few CRUD part which I don’t need to do with Grails, which is again good thing, All I have to do is, create domain class, create controller, map them and slap them. Bam! CRUD page is ready! And gsp is sight for sore eyes, if you have only worked with JSP till today(which I heavily doubt apart from people who always stay in maintenance work). As I stopped working in JSP long ago, gsp never impressed me. But still much better than JSP, and it looks much similar to some template engines available for Node.js. And most important thing is, it sure reduced lot of boilerplate code. Even if I don’t use scaffolding, LoC is greatly reduced compared to Spring counterpart. That is something to be considered.

After initial phase of Wow, and Oooh is over, you have to face the fact. I wanted to use JPA as I wanna give it a try and see if it really get along with Grails,. Boy, it wasn’t as easy as I thought it would be. I had to do a lot of hoopla and dropped the idea, as it was taking much more time than I expected. Not worth the time, as it is for my pet project. GORM is decent enough, well, at least for me.

Now, for worst part, speed is awful. I know, but for dev, productivity is important and every time I make changes in Java, it hot-reloads and at same time, system started slowing down. At certain point, it feels like slideshow. So I had to kill few processes to get it back to life.

Plugins : Yes, there are plugins. Lots of plugins!! You want to do X, chances are you already have X plugin. Certain things were made real easy, which makes me cry in joy! But by looking at source/issues you can see, even most popular one’s are discarded by it’s author. Yeah, it is open source and we can do whatever we want, but honestly, that’s not something we want. As much as I love to work in OSS, making it work for our requirement is again an development hurdle in my opinion.

So, what the hell am I thinking? If it matters for you, I pretty much like Grails, and as a Spring developer, it is quite an interesting journey. But do I consider using it in my existing project? I don’t know. It is not worth it. May be if something new and small comes in my way, I might give it a try. Next time, I use it for some real small project and blog here, on how it went?

Advertisements

What Grails(Groovy on Rails) did to my PC?

You might have seen Tesla S reaching 0-100 in 3.2 secs, but with Grails under the hood, my PC can go from 0-100 in few milliseconds. Yes, it is that fast! Only difference is, with Tesla S doing that, you will be like WTF!!! This is amazing and with Grails, it will be like WTF!!! This is bullshit.

Yes, my PC has been serving me well for past 5 years and even though it is C2D, 4GB with HD4850 under the hood, it helped me play GTA 4, FC3 and many other modern games and I am pretty happy with it. Felt my PC was laggy once every 3 months, but then again it was my fault as I always overload system with lot of applications loaded. Even with Crysis 3, I never felt my PC is aging. But Grails changed my perspective.

Started my PC, and bootup time is always close to 1 minute as I don’t have any big clog-y startup programs. Then I opened command line and typed >grails create-app sample.System seems like slideshow for a cuple of minute, then fine.

Finish up all work, then type >grails run-app, Bam!! CPU Usage is 100% till it compiles and build the project. I hardly see this happening, and even the resource hungry GTA 4 did good in my PC, but Grails, simply put the PC to shame! I guess it is time to upgrade my PC. Finally want to say one word to Grails Developers, WHY!!!!!!