• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

use of object oriented scripting

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

This is a very general question. I have over 5 years of experience working on java j2ee apps. I see a lot of Ruby on Rails and Groovy Grails articles on popular java sites but have not fully understood what problem areas do they resolve.
What advantages does object oriented scripting introduce.
My question may sound naive but what I am trying to ask does object oriented scripting language like RoR and Groovy Grails complement java j2ee development or provide a superior alternative.
For example say if I take a traditional J2EE project how do I visualize the usage of such object oriented scripting languages. How can it make life more easier from a development maintenance perspective of an application.

-Mohit
 
Ranch Hand
Posts: 490
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ruby on Rails is not a language. Ruby is the language. Rails is the framework.

Rails solves the problem of making something that should be easy but often easy, easy almost all of the time. Servlets and JSP is a very complex solution to building web sites. It really shows the ugly side of Java, IMO. I can give you lots of examples, but consider that 4 lines of code + 1 small line in each controller, if you need fine tuned control, is all it takes to block people who are not logged in from accessing your web pages.

Most of the 'P' languages in LAMP often produced messy code with model stuff in the view and controller stuff all over the place.

Rails abstracts the model so transparently that it usually takes 1 line to switch databases. It also keeps the M, V, and C nicely separated, and actually enforces MVC.

It also has a built in CVS-like system of creating, maintaining and changing tables.

It has a ton of built in helpers that turn that messy 50 line JSP code into 1 or 2 simple lines of ruby.

It has great AJAX support, often allowing for a simple 2 or 3 lines to do some really cool stuff in this area.

In short, it allows you to have a functional website up and running in the time it takes to edit a XML file in JSP. AKA, it makes it easy to actually create something.

It is not perfect, and probably not even close to make it into the enterprise ring, but it solves the problem of taking care of all the mundane details so you can do something interesting. And as easy as it is to create something in Rails it is not easy to deploy it, but honestly it isn't that much more difficult then setting up Tomcat for production. If you need to break convention, sometimes it is a bit tough, but not always.

I don't know much about groovy/grails, and honestly am not interested. Ruby is a much cleaner language then just about anything else out there.

Give it a spin and see what you think: www.rubyonrails.com It takes less then 10 minutes to download and install ruby, gems and rails. You also get an awesome built in testing web server. Then click on get better and see what you can build in 15-20. Most people are stunned at how quickly they can bring up a basic web site.
[ October 21, 2007: Message edited by: Rusty Shackleford ]
 
knowledge is the difference between drudgery and strategic action -- tiny ad
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic