Thursday, June 21, 2007

Grails vs Rails Myth #1: Grails has a fraction of what Rails has to offer

In this post the author proclaims boldly that Grails has a "fraction of RoRs functionality". So in the spirit of Relevance's myth series (I'm not sure I'll do more than one of these, we'll see) let me sum up my feelings on this.

I would like to have jumped right onto the Rails bandwagon if it hadn't been for the fact that ActiveRecord offers only a fraction of what Hibernate does.
  • Where is the proper transaction & conversation support?
  • Why is it that it hits the db orders of magnitude harder that Hibernate does and is infinitely slower?
  • Where is the criteria support? What about distributed caching?
I would be Ruby maniac right now if Ruby didn't offer only a fraction of what is available in Java. From the reams of web frameworks, to the dozens of persistence engines, to distributed caches, enterprise integration tools and testing frameworks. Java has it all. There is literally a library for everything.

And I would probably have said a long goodbye to Java, if it wasn't for the fantastic innovation that is happening in projects like Spring and Hibernate and the libraries that integrate with them (Quartz, Sitemesh, Compass, Acegi, Webflow et al) which Grails is built on. Want an RMI, burlap, http, soap or DWR service? Just expose one. Need advanced declarative security at the web and business layer level? Plug it right in. Job scheduling? Job done. Search? Sure no problem.

Spring and all the projects that integrate with it, make the Java ecosystem a very happy place indeed. So no, Grails might not have RJS (yet), migrations (yet) or xyz feature from Rails, but it has plenty, thanks to the Java eco-system, to make up for it and then some.

24 comments:

Christian Seiler said...

I find the whole Ruby/JRuby/Rails/Groov/Grails debate very interesting. So long I've been at home mainly in Javaland, so I'm pretty aware of the adavantages Grails has to offer in terms of Java-integration. My two major reasons why I probably will nevertheless try out Rails in future (now that you can deploy Rails application on the JVM):

- it seems to me that writing GSP code is much like JSP. And I hate to write these "c:choose c:when when c:otherwise.." tag orgies. It's just so ugly to write (and that is also the feedback of my project team's members) and I'm sick and tired of this.

- Rails/Ruby simply has just such a big momentum and I like to have a thorough understanding of the Rails platform to have an own attitude

Graeme Rocher said...

By god man and you prefer Rails' scriplet based RHTML? That is strange..

scriplet <% %> orgies are even more lame, at least tags are well formed

Antonio said...

If you enjoy tag-based views, hobo has DRYML, which provides the same (arguably, far more flexible) abilities.

Christian Seiler said...

Don't know if I prefer rhtml. I'd like to try it out and see, as I pointed out above. Maybe you're right. It's just the thing that a simple if-then-else is so very verbose having to write all those tags. Maybe I'll be sick and tired of rhtml even faster.

By the way I wish you all the best for Grails

Graeme Rocher said...

Thanks Christian, and good luck with Rails or whatever framework you go with the end :-)

Cheers
Graeme

George said...

Indeed antonio, Hobo floors anything I've seen for cleaning up Rails at the moment. And it appears that some great things are going to be happening soon for it developmentally.

masukomi said...

Hey Graeme I wrote a response to this but it was a bit too long for a comment.

Gernot said...

Rails has the "less is more" approach wich I like very much after years of work with huge frameworks (je22 and .net). The real power of rails comes from the language, ruby. Java and C# seem clumsy to me now.

Graeme Rocher said...

@antonio & george
The ideas from Hobo come from Grails. Tom Locke the creator saw Grails' taglibs before he started working on it as I showed him :-)
He won't admit he got the idea from Grails, I guess due to the not-invented here syndrom running through the Rails community (I'm happy to admin we took many ideas from Rails). Sorry Tom, but this is fact!

@gernot
Sure, if you feel RJS is more important than transactions than go for it ;-)
I don't imagine many big enterprises will.

Graeme Rocher said...

@masukomi (kate)
I posted response on your blog

James said...

You don't have to use RHTML with rails, there's always haml: http://haml.hamptoncatlin.com/

Graeme Rocher said...

HAML looks lovely, unfortunately I doubt any designer tools like Dreamweaver will grok this:

#content
.left.column
%h2 Welcome to our site!
%p= print_information
.right.column= render :partial => "sidebar"

We chose to use tags for a reason :-)

Jerrett said...

Or better yet (re: rhtml,haml,etc), Markaby :)


or whatever else suits your fancy, liquid, etc.

salient1 said...

Personally I think HAML looks like garbage. I realise it's nice and terse but it's very ugly looking and as Graeme already mentioned, tools like Dreamweaver won't like it one bit.

That said, I think things like JSP, HAML and RHTM are antiquated ways of doing web development and MUCH prefer using Wicket for web development. It's the only thing that doesn't make me cringe when I look at it. Grails has a plugable view technology so I'm interested to see how far Graeme can take Wicket on Grails. :)

James said...

AFA Dreamweaver and HAML: It shouldn't be much harder than parsing CSS. I don't see why that would be a problem.

AFA Transactions: Rails has had transactions since before Rails 1.0. I'm not sure where you got the idea that they didn't.

I've never heard of 'conversations' or 'criteria' in DB terms. I'll look into that. Maybe it'll be my chance to contribute to Rails core.

Distributed caching can be done with memcached or other caching frameworks. I don't see why it would need to be part of the framework. And I personally expect that using a native app, like memcached, is more powerful than mixing it into the system.

Finally, as far as time. You win. If what you say is true, and I totally believe it is, Rails is hard on the DB, apparently for no good reason.

JD

Graeme Rocher said...

James,

HAML:

Err.. you think Adobe are going to invest their time and money to write a special parser for HAML? I don't think so. Dreamweaver knows how to deal with XHTML+CSS, not some weird custom format

Transactions:
Hibernate has a concept of a session which accumulates changes which are then flushed to the db at an appropriate point in time. This means you can have a conversation with the db that spans multiple requests where the changes are only commmitted maybe several requests later. All the time hibernate is rarely hitting the db.

I'm perfectly aware Rails supports db transactions, but container managed transaction spanning multiple requests is not, as far as I'm aware, possible.

Distributed caching:
With all due respect to memcache, having worked with it before it is a mere toy compared to some like Coherence with its features for transparent failover, multicast cluster management, entry processors, querying/filtering etc.

I do agree that it doesn't need to be part of the framework, all I'm saying is that the libraries in Java land are superior on multiple levels

Michael said...

Graeme, i think Masukomi makes a good point in his blog and writes more precisly what i paraphrased somewhat rough.

I don't doubt that Hibernate is in any way inferior to ActiveRecord but the whole bunch that RoR represents its imho much more usable (from a developers view) out of the box than Spring + Hibernate alone.

In a team with 3 people it's hard to choose the right technology if one must expect getting lost while configuring things in mess of xml files.

You wouldn't be working on Grails if there wouldn't be a wish or need among Java coders for something like rails. You quote Les Hazlewood with "I found Grails and it was like the heavens opening and angels singing "AAAAaaaaawh". I think he didn't discover anything new with Spring and Hibernate but saw that J2EE can be made a lot easier: Starting to write your closures and views instead of open your xml editor of choice just for configuring an app.

I didn't mean to flame with my post, really. I see myself in both worlds. For my own stuff (http://dailyfratze.de, a daily photo project) and some other private stuff i use RoR and i "love" it. Clearly, i don't need transaction spanning multiple request in this project.
At work we are heavily devoted to Java, both desktop apps and J2EE.

Kind regards from Germany,
Michael.

Christian Seiler said...

Like I told in my intial comment (see above) I really wanted to try out Rails. So I bought the obligatory books and started getting into it. Initially I was really impressed. Everything seems to be well thought out and seems to work hand-in-hand. No switching between all those different libraries, which come with different documentation, quality and philosophy.

My plan was to create an administration interface for an existing Sping/JPA webapp using Rails. So far I failed miserably:
I couldn't find a way to make ActiveRecord deal with my legacy database schema, which uses the "join" strategy to map a small simple class hierarchy to the database. I learned that ActiveRecords supports the "single table per class hierarchy" strategy only (which is a no-go in my case). This is really a showstopper for now. On my way learning I also noticed several other weaknesses of ActiveRecord (second-level cache missing and some other stuff). I wouldn't have thought that ActiveRecord is really that weak compared to Hibernate/JPA, since it is around for some years now.

Maybe I will try out Rails again when starting a complete new project. But for now my initial excitement about Rails yielded to disappointment.

Ray Krueger said...

I realize this post is a year old, but it deserves a follow-up :)

Setting up grails to use memcached is incredibly easy if you use the hibernate-memcached :) http://code.google.com/p/hibernate-memcached/
(end shameless plug)

derfefww said...

I always heard something from my neighbor that he sometimes goes to the internet bar to play the game which will use him some Atlantica online Gold,he usually can win a lot of Atlantica Gold,then he let his friends all have some cheap Atlantica online Gold,his friends thank him very much for introducing them the Atlantica online money,they usually buy Atlantica online Gold together.

Anonymous said...

網頁設計,情趣用品店,情趣用品專賣網

A片,色情A片,免費A片,成人影片,色情影片,a片免費看,情色貼圖,情色文學,情色小說,色情小說
AV,AV女優

辣妹視訊,美女視訊,視訊交友網,視訊聊天室,視訊交友,視訊美女,免費視訊,免費視訊聊天,視訊交友90739,免費視訊聊天室,成人聊天室,視訊聊天,視訊交友aooyy
哈啦聊天室,辣妺視訊,A片,色情A片,視訊,080視訊聊天室,視訊美女34c,視訊情人高雄網,視訊交友高雄網,0204貼圖區,sex520免費影片,情色貼圖,視訊ukiss

Anonymous said...

Do you want to buy the cheapest dofus kamas, I think many people want to buy the cheapest dofus gold, but some times we all do not how to buy dofus kamas, so we all hope in the game can earn much cheap dofus kamas, this is the best hope for us to play the Dofus.

Anonymous said...

^^ nice blog!! ^@^

徵信, 徵信網, 徵信社, 徵信社, 感情挽回, 婚姻挽回, 挽回婚姻, 挽回感情, 徵信, 徵信社, 徵信, 徵信, 捉姦, 徵信公司, 通姦, 通姦罪, 抓姦, 抓猴, 捉猴, 捉姦, 監聽, 調查跟蹤, 反跟蹤, 外遇問題, 徵信, 捉姦, 女人徵信, 女子徵信, 外遇問題, 女子徵信, 外遇, 徵信公司, 徵信網, 外遇蒐證, 抓姦, 抓猴, 捉猴, 調查跟蹤, 反跟蹤, 感情挽回, 挽回感情, 婚姻挽回, 挽回婚姻, 外遇沖開, 抓姦, 女子徵信, 外遇蒐證, 外遇, 通姦, 通姦罪, 贍養費, 徵信, 徵信社, 抓姦, 徵信, 徵信公司, 徵信社, 徵信公司, 徵信社, 徵信公司, 女人徵信,

徵信, 徵信網, 徵信社, 徵信網, 外遇, 徵信, 徵信社, 抓姦, 徵信, 女人徵信, 徵信社, 女人徵信社, 外遇, 抓姦, 徵信公司, 徵信社, 徵信社, 徵信社, 徵信社, 徵信社, 女人徵信社, 徵信社, 徵信, 徵信社, 徵信, 女子徵信社, 女子徵信社, 女子徵信社, 女子徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信社,

徵信, 徵信社,徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 外遇, 抓姦, 離婚, 外遇,離婚,

徵信社,徵信, 徵信社, 徵信, 徵信社, 徵信,徵信社, 徵信社, 徵信, 外遇, 抓姦, 徵信, 徵信社, 徵信, 徵信社, 徵信, 徵信社, 徵信社, 徵信社, 徵信社,徵信,徵信, 徵信, 外遇, 抓姦

cvxv said...

看房子,買房子,建商自售,自售,台北新成屋,台北豪宅,新成屋,豪宅,美髮儀器,美髮,儀器,髮型,EMBA,MBA,學位,EMBA,專業認證,認證課程,博士學位,DBA,PHD,在職進修,碩士學位,推廣教育,DBA,進修課程,碩士學位,網路廣告,關鍵字廣告,關鍵字,課程介紹,學分班,文憑,牛樟芝,段木,牛樟菇,日式料理, 台北居酒屋,日本料理,結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,台北結婚,場地,住宿,訂房,HOTEL,飯店,造型系列,學位,SEO,婚宴,捷運,學區,美髮,儀器,髮型,看房子,買房子,建商自售,自售,房子,捷運,學區,台北新成屋,台北豪宅,新成屋,豪宅,學位,碩士學位,進修,在職進修, 課程,教育,學位,證照,mba,文憑,學分班,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,住宿,訂房,HOTEL,飯店,婚宴,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,住宿,訂房,HOTEL,飯店,婚宴,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,住宿,訂房,HOTEL,飯店,婚宴,結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,台北結婚,場地,結婚,場地,推車飲茶,港式點心,尾牙春酒,台北結婚,婚宴場地,結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,台北結婚,場地,居酒屋,燒烤,美髮,儀器,髮型,美髮,儀器,髮型,美髮,儀器,髮型,美髮,儀器,髮型,小套房,小套房,進修,在職進修,留學,證照,MBA,EMBA,留學,MBA,EMBA,留學,進修,在職進修,牛樟芝,段木,牛樟菇,關鍵字排名,網路行銷,PMP,在職專班,研究所在職專班,碩士在職專班,PMP,證照,在職專班,研究所在職專班,碩士在職專班,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,EMBA,MBA,PMP
,在職進修,專案管理,出國留學,EMBA,MBA,PMP
,在職進修,專案管理,出國留學,EMBA,MBA,PMP,在職進修,專案管理,出國留學,婚宴,婚宴,婚宴,婚宴,漢高資訊,漢高資訊,比利時,比利時聯合商學院,宜蘭民宿,台東民宿,澎湖民宿,墾丁民宿,花蓮民宿,SEO,找工作,汽車旅館,阿里山,日月潭,阿里山民宿,東森購物,momo購物台,pc home購物,購物

漢高資訊,漢高資訊,在職進修,漢高資訊,在職進修,民宿,民宿,整形,造型,室內設計,室內設計,漢高資訊,在職進修,漢高資訊,在職進修,民宿,美容,室內設計,在職進修,羅志祥,周杰倫,五月天,民宿,民宿,整形,整形,室內設計,室內設計,比利時聯合商學院,在職進修,比利時聯合商學院,在職進修,漢高資訊,找工作,找工作,找工作,找工作,找工作,蔡依林,林志玲