Slashdot Mirror


Ruby on Rails and J2EE: Room for Both?

Wayne writes "Ruby on Rails is a relatively new Web application framework built on the Ruby language. It is billed as an alternative to existing enterprise frameworks, and its goal, in a nutshell, is to make your life -- or at least the Web development aspects of it -- easier. This article will contrast the Rails framework against a typical J2EE implementation using common open source tools that are regularly found in enterprise applications."

17 of 47 comments (clear)

  1. I just started it about a week ago by hammeredpeon · · Score: 4, Interesting
    And I've already written lots of apps that I'd been meaning to get to with j2ee.

    Don't get me wrong. I love java and hibernate and all of the powerful ideas it introduces and brings to the table, but RoR just makes things so easy and fast. I don't know how easy it would be to write something huge in it, but lots of my initial reservations about it were shed when I started playing with it.

    If you haven't given this a try, I'd really suggest you do it. With this giving developers such an easy time writing web apps, and having an alternative with java that's more verbose but proven and (maybe) more powerful, I don't see any room for .net anymore. Unless you like writing non-MVC apps :)

    --
    best college pickem site ever: pickem.terrbear.org
    1. Re:I just started it about a week ago by Ogerman · · Score: 2, Insightful

      I love java and hibernate and all of the powerful ideas it introduces and brings to the table, but RoR just makes things so easy and fast. I don't know how easy it would be to write something huge in it..

      RoR makes easy things easy, but Java makes hard things possible. (You could also insert Python, Perl, or PHP in place of RoR and that statement would be equally true.) The "alternatives" to Java are all missing an O/R tool as powerful as Hibernate, an AOP/IoC framework as powerful as Spring or AspectJ (if they have one at all), and a UI framework as powerful as Tapestry or JSF. The IBM article in the parent post is pretty terrible because it compares Java vs. RoR for ultra simple web applications which could be feasibly implemented in ANY language. It wouldn't surprise me if RoR is an excellent alternative to PHP, but it's nowhere near an alternative to Java for that which Java does well.

      I don't see any room for .net anymore. Unless you like writing non-MVC apps :)

      Largely through copying of what has worked with Java and friends, .NET has become a very strong competitor to Java for mid/large scale applications. ..So beware of becoming too smug. And there's nothing saying that .NET apps are non-MVC. The next several years are going to have developers on each side working hard to surpass what the other is doing. If Ruby wants to compete with the big dogs, it's going to have to grow up really quickly and get some real tools in its belt. Right now, Ruby is not something you would use to write a large, complex enterprise app. At this point, the Open Source community would be far better off rallying behind Java (aka. a Free "java") than any scripting language or immature newcomer like RoR. Java needs to be improved, but it already does an enormous amount right.

  2. Python will kill Ruby by duffbeer703 · · Score: 4, Interesting

    Look at this new project, just announced a few days ago:
    http://www.djangoproject.com/

    Django is basically RoR for Python. When you consider the Java-Python integration options available, plus the larger number of Python devs outside of Japan, I think this is a the way of the future.

    --
    Conformity is the jailer of freedom and enemy of growth. -JFK
    1. Re:Python will kill Ruby by keesh · · Score: 3, Insightful

      Except that python doesn't even come close to ruby in terms of power. Try implementing Rails' 'belongs_to' in python... It's when you start to do neat tricks like this that the advantages of having real higher order classes (as opposed to the python Klass hack) and real higher order functions (as opposed to what python laughingly calls lambda) shows up.

    2. Re:Python will kill Ruby by ak3ldama · · Score: 2, Insightful
      When will open source grow up and recognise that the the market won't support this many variations on a them?

      It's pretty simple, once a developer/group/company builds up a lot of functionality in API's or Classes, or just gains experience using one language, it is easiest and best for them to try to use that language with the new addon instead of trying to learn something new (such as RoR).

      It is not always possible or viable to use something just because it is the "great platform."

      --
      "but money is the God of Algiers & Mahomet their prophet." - Rich. O'Bryen June 8th 1786
    3. Re:Python will kill Ruby by CatGrep · · Score: 4, Funny

      ruby is just too obscure!

      Damn! Wish I would've known that before I decided to learn Ruby because of all the good things I was hearing about it. But now you tell me it's obscure! Man, I feel so betrayed by all those people who were telling me about how great Ruby is. I had no idea all those people (some with some pretty impressive credentials like the Pragmatic Programmers, the creator of Ant, etc.) were trying to lead me astray. My coworker was showing me how much more productive he was programming in Ruby - was that all just an act? Well, it just proves that you just can't trust anyone these days, eh? Damn!

    4. Re:Python will kill Ruby by croddy · · Score: 3, Interesting
      I spent the past couple of weekends working on a messageboard in Rails. I don't know about the "ten times faster development" claims... but I do feel like I'm getting around three times as much done versus working in PHP -- and I already knew PHP, but just started to pick up Ruby a couple of weeks ago. When they say this framework "fits your brain", they really mean it.

      The Rails folks are very good at marketing -- but they surely haven't forgotten to put a solid product behind that buzz.

      As for Ruby losing to Python? Well...

      At work, we're in the middle of re-implementing OCLC's PURL redirection server (which is a tasty casserole of Perl, C, and god only knows what else). With the goal of demonstrating that we don't need our own private copy of Apache (as OCLC uses), a pile of ReWrite rules, and an army of Perl scripts to work with its Berkeley DB backend, I threw together a quick demo using Ruby's WEBrick servlet and connected it to PostgreSQL. Thankfully, I was able to persuade the decision-makers that a scripting language and an RDBMS are a reasonable solution to our problem... but their attitude toward Ruby was similar to yours. "I dunno, I haven't heard much about it, let's use something else."

      We settled on Python, which, of course, has its own SimpleHTTPServer which fills roughly the same niche as WEBrick. But it's slower, it dies if you throw too many concurrent connections at it, and its built-in methods are far cruder than those of its Ruby counterpart. I'm going to have to write a lot more code to pull it off in Python.

      Obviously this is an anecdotal example... but I just keep coming across things in Ruby that simply make more sense, and just work better than they do in other systems. After a couple of weeks, I'm certainly sold -- even though $PREFERRED_LANGUAGE will keep paying the bills, Ruby is a great tool to have at my disposal.

  3. One nice RubyOnRails feature... by tcopeland · · Score: 2, Interesting
    ...is how it's very simple to put together an XMLRPC or SOAP interface to a back end API. Just put a
    web_service_api :MyAPI
    in your controller class, and Bob's your uncle. Another nifty bit is:
    web_service_scaffold :invoke
    which enables an HTML user interface for invoking methods on SOAP or XML-RPC services. Makes rapid prototyping very, well, rapid.
  4. Stupid by jlarocco · · Score: 4, Insightful

    That's like asking C++ and Java, room for both? Or, Chevy and Ford, room for both?

    Of course there's room for both, and if there's not, who cares?

  5. Nitro kills Django dead by CatGrep · · Score: 2, Informative

    The future is here.
    Django is now old news...

    Yeah, Nitro is in Ruby. But considering that RoR has opened the Ruby door so that many people have been learning Ruby lately ( and also considering that it's quite easy to go from either Perl or Python to Ruby) that's not a problem. Excellent Ruby web programming frameworks are now popping up like mushrooms after a Fall rain.

  6. Ruby is just too secure by Colonel+Panic · · Score: 2, Funny

    ruby is just too obscure!

    And this, of course, is what makes Ruby so secure.

  7. Re:I've not yet used Ruby by G-Licious! · · Score: 2, Informative

    Speaking of Python, make that room for three.

    (Perhaps even 4 with Zope, I guess)

  8. of course there's room for both! by Anonymous Coward · · Score: 4, Insightful

    That's like two people standing in a room and saying "is there room for us both in here?" Well, duh, you're both in there now, so yes, there's room!

    If I had a team of 50 programmers working on a gigantic site, and the programmer turnover was high, and these folks put in a good day's work but weren't hardcore programmer geeks, I would probably choose Java. Type safety, verbose explicit code, huge array of tools and vendor support, this is the stuff of "joe sixpack programmer".

    However, for small focused teams with passionate programmers (folks who program 10 hours a day at work, and then go home and do another 4 hours just for fun, and then write their own IDEs on the side), I would definitely choose Ruby on Rails. Java would just slow us down.

    And don't think for a minute that there's anything revolutionary about RoR. This is an old debate: do you create a powerful and expressive "domain specific language", which takes time to learn and understand but allows you to work at high velocity once up to speed (example: RoR)? Or do you go for slow and steady but with a quick ramp-up (example: PHP).

    The great thing about RoR is it brings this style of metaprogramming to the masses with a pragmatic language like Ruby. I love languages like Lisp, and they can blow Ruby out of the water, but try and do something simple like connect to a database and you enter a sea of incompatible confusing half-finished code and rude IRC denizens.

  9. Re:RoR? by Tobias+Luetke · · Score: 2, Insightful

    Anyone experienced in ruby on rails will match any team of 5 struts programmers in productivity.

    You are absolutely and utterly kidding yourself. All idea does is fix java. An IDE like this is just not required for ruby like service pack 2 is not required for linux.

  10. Re:Tapestry and Spring? by martinde · · Score: 2, Interesting

    You might want to check out this article about Trails when you get a chance. Trails uses the some of the more interesting J2EE frameworks - (Hibernate, Spring, and Tapestry being some of the key pieces) to create something quite like Ruby on Rails but with Java under the hood... In the interest of full disclosure, I know the creator of Trails from my old Java user's group in Cincinnati.

  11. Re:RoR? by megajini · · Score: 2, Insightful

    Hell, of course the IDE has to do the stuff that Ruby does by being dynamic. Example: For ActiveRecord you would need

    • Database-Integration to generate mapping XML-files
    • A code generator to generate dumb classes (.java sourcecode) from bindings
    • Finally generate some helper classes, config and you're done
    This all results from the nature of Java. But, if you do the "generator"-way this results in much snappier applications. Currently (including Hibernate) everything circles around IOC and code injection (CGLIB), thus it's hard to clearly beat RoR. To match it (on the same field) you could enhance Groovy a bit and you would practically get the same... (because Groovy is dynamic)

    I would enjoy some more code-generation (with ant, that's not really a problem). This would be more the C-way (kind'a retro), but hell fast and very cool in a decent IDE (think of Class-Browsers, JavaDoc support...).

  12. Rails not the only Ruby Web Framework by gmosx · · Score: 3, Interesting

    If you love Ruby (and why wouldn't you), there are more alternative web frameworks. Have a look at Nitro (http://www.nitrohq.com/ and the Og object relational mapping library. Nitro, in true Ruby spirit, gives the developer choice, instead of enforcing the design of the application or specific patterns. And Og is a completely oo solution that transparently maps Ruby objects to sql (or non sql) stores and not vice versa.