• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Groovy / Grails vs Java / Restful

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
reply
    Bookmark Topic Watch Topic
  • New Topic