Rails Rocks… (A perspective from Java Engineer)

After working with Java/J2ee applications for 7 long years I always had prejudice that Java/J2EE is best for web based/server side application (Though I have entirely different opinion about client side java).

I also wanted to learn/work some alternative technologies like .Net/Python/Ruby/or any language with metaprogramming. This curiosity was enough for my manager to assign me a task on Ruby on rails in my free time.

The vision of the project was to create a Rich Internet Application for Event and Stall management for one of our tech fest. As usual the deadline was very stringent.I was really wondering about the deadlines as I need to learn both ruby and rails. Initial look on Ruby examples was sort of scary as the syntax was completely different.

The assignment was really an eye opener as I understood how much faster and easier I can prototype, develop and deploy database driven rich web application. The application resembled a desktop application and it contained cool feature like drag and drop,ajax driven admin screens etc… All these were done in a record time of 100 Person hours and this includes the learning curve for Ruby and rails.As one of our Architects estimated the same application would have taken 550 to 600 Person hours in Java/.Net (Not including the learning curve)

Key Features

  • Ideal for database driven rich web applications.
  • Fast to develop and deploy. (In fact 5x faster than developing in Java / .Net if we follow few conventions)
  • More maintainable as we end up writing less code.
  • Seamless integration between web and persistence layer.
  • Rapid Prototyping.
    Built-in testing.
  • Plugin support
  • Good community support.
  • Open source.

Downsides

  • Poor support for legacy schemas.
  • Still a new technology. May be getting people to work on rails projects cannot be as easy as Java

8 Responses so far »

  1. 1

    afsina said,

    maybe you felt that way because you were developing under using J2EE 1.4 with archaic app servers under java 1.4? (eg websphere)?

  2. 2

    I dont think App servers makes a big sense here(Because I am talking about the developement time).
    I think the ORM in Rails(Active Record), Scafolding (Ajax Scaffolding) , Metaprogramming, built-in-testing etc.. gives leading edge to rails than any comparing technologies. Another feature that fascinated more in rails is seamless integration between web and persistence layer. To do the same thing in J2ee using Spring & Hibernate I can remember how many xml file I wrote. I agree current version of hibernate no need seperate config file, rather we can map it with annotations. But still by following just few conventions in rails I can just declare the class and I can persist it. I can list some many goodie feature in rails, but that may make my reply bulkier.

    Thanks for your feedback.

  3. 3

    frobot said,

    App server or JDK versions make neglible difference in productivity.

    Just the immediacy of editing code and checking results, vs. the slow edit-compile-deploy (and often restart) cycle of a J2EE app-server is a huge productivity boost.

    The best thing about Rails is it makes it easy to do the right thing, and unnecessary to do the wrong thing. One alleged strength of J2EE is the quality and maintainability of application code. But it’s just so tedious and labor-intensive, that in practice it’s difficult to do the right thing.

    Worse, it’s easy and tempting to do the wrong thing — e.g. excessive scriptlet code in JSP, cross-layer contamination, duplication, no unit tests, etc. This becomes a downward spiral — shortcuts result in less maintainability, resulting in more time pressures, incenting more bad behavior.

    So while an environment like PHP are often criticized as being quick-and-dirty, in reality J2EE projects degenerate into slow-and-dirty.

    The natural state of Rails apps is quick-and-clean. It doesn’t require constant policing, vigilance, and energy to make sure the team produces good, maintainable, testable code.

  4. 4

    fixer said,

    frobot: just one example, i recently used stripes, it is a very clean and fast web application framework. it incorporates well with spring or hibernate and requires almost no seperate configuration files. why would i bother with rails if i have something give me the similar gains with better performance and tool support? Seam is another good example..

  5. 5

    [...] Rails Rocks… (A perspective from Java Engineer) « Techie by Mind…. [...]

  6. 6

    Aejaz said,

    I guess you haven’t tried EJB3(No XML needed) or haven’t worked with large scale applications. I have evaluated rails & have dropped it due to several reasons, namely,

    - Questionable scalability
    - Too low level to manipulate the view side(lack of UI components)
    - Lack of application packaging facilities
    - Lack of code obfuscation which is necessary to protect your IP if you want to
    sell your application
    - Big one : Lack of tool support

    I have more reasons but this should suffice for now.

  7. 7

    I have worked with Hibernate3 and annotations ( I always thought EJB3 was based on Hibernate ;) ). But someway I feel activerecord was more appealing, may be it was perfectively wired with Actionpack.

    Question about scalability came to my mind also. But I have not done any benchmark test to confirm the same. I am seeing lots many contents that contradict the fact that “Rails is not Scalable”
    http://www.loudthinking.com/arc/000479.html

    I dont agree with lack of tool support as “RadRails” was pretty stable and more than enough for most of my needs. Though I didn’t tried the debugging features.

    I thought Ruby Gems was perfect answer for packaging rails apps? Though I have not tried it.

    Another interesting thing I learnt about rails was, we can distribute rails app as exe(Sadly only for demo, Not production friendly). Just by clicking the exe we can see rails app in the browser (Even without ruby installed on client machine). I have not tried this though.
    http://www.erikveen.dds.nl/distributingrubyapplications/rails.html

    I agree with you about code obfuscation and IP concern. But my point here is , any code if they want can be de-obfuscated. :)

  8. 8

    Dr.Ranjith said,

    Excellent article Mr. Vijay. There are so many things which we never think about until we come across a problem. This article is definitely proactive in nature and I am sure that many people are going to benefit a lot from it.


Comment RSS · TrackBack URI

Say your words