aspose file tools*
The moose likes Groovy and the fly likes Groovy / Grails vs Java / Restful Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Groovy / Grails vs Java / Restful" Watch "Groovy / Grails vs Java / Restful" New topic
Author

Groovy / Grails vs Java / Restful

Chuck Staples
Greenhorn

Joined: Oct 22, 2008
Posts: 6
Many of the questions here seem aimed at those who already have some familiarity with Groovy.
As a new Java programmer, I don't have any context for why Groovy / Grails might be better suited for a web application than plain old Java with Restful web services.

Can you briefly list the advantages ( and disadvantages, if any :P ) of using Groovy / Grails vs Restful services?

=chuck

=cjs
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

There's no reason to say Grails/Groovy vs RESTful services. Grails has REST built in. I'm currently building a platform for an iphone application and it is all Grails and all RESTful. It's a beautiful thing.


GenRocket - A Test Data Generation Platform
Michael Kimsal
Greenhorn

Joined: Nov 08, 2008
Posts: 1
Chuck Staples wrote:Many of the questions here seem aimed at those who already have some familiarity with Groovy.
As a new Java programmer, I don't have any context for why Groovy / Grails might be better suited for a web application than plain old Java with Restful web services.

Can you briefly list the advantages ( and disadvantages, if any :P ) of using Groovy / Grails vs Restful services?

=chuck


Groovy (and some other alternative JVM languages) offer one meta-advantage over 'pure' Java - easier to read code. In most (almost all?) cases, a developer can express something in Groovy in fewer lines of code than Java. The fewer lines of code don't necessarily lose much expressiveness, but manage to convey the same concepts as 'pure' Java, just with fewer lines of code. Fewer lines of code *generally* means fewer bugs, because there's fewer LOC where bugs can be introduced.

There are numerous comparisons on the web of 'canonical' Java code vs the same functionality expressed in Groovy, and the Groovy code is (almost?) always shorter, often significantly so.

Writing Groovy is Java minus the boilerplate stuff. For those who say that "my IDE make the boilerplate, so it doesn't matter" I say you're wrong - it does matter. Having to work with code that is 100 lines of Java when 20 lines of Groovy would do is painful, leads to potentially more errors, and usually takes longer to make whatever changes/upgrades/fixes need to be made.

Disadvantages? IDE support isn't as snazzy as it is for 'pure' Java. Groovy is slower than Java. Sometimes it's just a bit slower, sometimes it's significantly so. For those sections of your code you can 'fall back' to writing pure Java - they can be mixed and matched in the same file even, so no big issue there (imo).

I'm somewhat biased, but I suspect most people are one way or another...

Michael Kimsal
http://groovymag.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Groovy / Grails vs Java / Restful
 
Similar Threads
groovy vs grails
Groovy vs. Rails question
Groovy, Web Services and EJBs
What does Groovy/Grails offer?
Seam vs Grails