Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Java Programming

Ruby on Rails and J2EE: Room for Both? 47

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."
This discussion has been archived. No new comments can be posted.

Ruby on Rails and J2EE: Room for Both?

Comments Filter:
  • as there are a lot of other languages out there that have occupied my interest. However, from my experience with Java, it would seem that Ruby on Rails is a really nice framework. I've recently begun working with Python and Zope, and am interested, personally, in how they compare, too.
  • by hammeredpeon ( 572012 ) on Monday July 18, 2005 @03:30PM (#13096910) Homepage
    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 :)

    • Stop being racist. It's spelled LoL ;)

      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.

      On a serious note, I honestly doubt the typical programmer can go from Idea to Working Code in Ruby any faster than you can do the same thing in Java. If you can personally, then I'd suspect you just aren't very good at Java.

      Not a personal attack, but there's just so many useful Java libraries that it's a s

      • Re:RoR? (Score:3, 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.
        • Re:RoR? (Score:2, Insightful)

          by megajini ( 557306 )

          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 (C

          • The article's about Ruby, so all the Ruby fans are reading and commenting and moderating, thus my "well Java's pretty damn good" comment sits at 1 and the reply saying how amazing Ruby is gets modded to 4 or 5.

            I'll say it again: couple a modern OO language with lots of native libraries all documented clearly with a decent IDE (method completion, auto-syntax checking) and I can solve just about any problem in software in a relatively short amount of time.

            Considering there's more lines of Java code in exis
            • I can solve just about any problem in software in a relatively short amount of time.
              many many job postings are for J2EE developers

              If your first statement is true, then I don't think you have to worry much about the second. I confess I have some doubts, though.

      • I've made some pretty big apps in java and I like it, but you really have to give it a try before blasting it. I've made some pretty complicated tie-in-with-local-hardware sites with rails in just a few days, which is probably the same amount of time it would have taken me to get all of the trivial stuff done w/ struts and hibernate.

        Of course, you can forget about RoR and just go with java and assume that people who think RoR is better are just bad coders, or you can give it a shot and see that there's a l

      • On a serious note, I honestly doubt the typical programmer can go from Idea to Working Code in Ruby any faster than you can do the same thing in Java. If you can personally, then I'd suspect you just aren't very good at Java.

        I honestly doubt that you know anything about Ruby (or Python, for that matter). Java is a heavyweight language. There's a lot of boilerplate (especially in crap like J2EE. There are lots and lots of testimonials about working with Ruby being easier and faster than working in Java -

    • 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 (
  • by duffbeer703 ( 177751 ) on Monday July 18, 2005 @03:34PM (#13096952)
    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.
    • by keesh ( 202812 ) on Monday July 18, 2005 @03:41PM (#13097027) Homepage
      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.
      • Just to clarify things for people, yes lamda is a poor cousin in Python, but no, that doesn't mean it doesn't have real higher order functions. Python has first class functions, and you can do every single one of the functional programming tricks with them, except write them inline as lambdas - you have to put them somewhere (although local functions work fine). Now, this bugs people who're used to writing functional code as little inline snippets all over the place, but the Pythonic way of doing this is no
        • Now, this bugs people who're used to writing functional code as little inline snippets all over the place, but the Pythonic way of doing this is no less powerful.

          Not less powerful, just less usable. In fact, from what I've seen, the Pythonic way is to not do it.

          Take a look at how pervasively HOFs are used in any idiomatic Ruby API (or those of all the languages that came before it). There is a qualitative difference between closures with anonymous functions, and closures only via first class functions.

          • It is extremely common for Python code to pass callables about. It's just not done with blocks and lamdas - it's a different style of programming. I prefer the Pythonic way, I think it's more readable and it lends itself better to maintainability and refactoring. I have no problem with people who prefer the more classic Ruby functional approach, but to claim that Pythons functional programming or HOF abilities are weaker because of the second class lambda is false. Functional programing is simply *different
    • No Ruby grinds Perl to fine dust, Ruby kills Python by smacking the snake on the head. Some say that the paper-covers rock rule applies to Python swallowing Ruby (and thus would constitute a win for the snake), however, what do you think comes out in the end of that encounter? Yes, nice try, but the Ruby endures.
    • The future is here [nitrohq.com].
      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.

  • by tcopeland ( 32225 ) * <tom AT thomasleecopeland DOT com> on Monday July 18, 2005 @03:48PM (#13097089) Homepage
    ...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.
  • Stupid (Score:4, Insightful)

    by jlarocco ( 851450 ) on Monday July 18, 2005 @04:16PM (#13097444) Homepage

    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?

  • So the comparison is made using the typical J2EE setup with Struts or something similar. I like writing J2EE apps but I just hate JSP, it's such crap.
    I'd like to see a comparison of RoR and a J2EE app that uses Tapestry, and maybe even Spring. Tapestry just throws JSP out the window and brings something much much better, cleaner, more powerful. People who have used WebObjects will understand very quickly the way Tapestry works. As for Spring, well, it just saves you a lot of headaches and a lot of code that
    • You might want to check out this article about Trails [java.net] 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 [cinjug.org] in Cincinnati.
  • by Anonymous Coward on Monday July 18, 2005 @06:47PM (#13098698)
    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.
  • by gmosx ( 865680 ) on Tuesday July 19, 2005 @03:35AM (#13101567) Homepage
    If you love Ruby (and why wouldn't you), there are more alternative web frameworks. Have a look at Nitro (http://www.nitrohq.com/ [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.
  • as there are a lot of other languages out there that have occupied my interest. However, from my experience with Java, it would seem that Ruby on Rails is a really nice framework. I've recently begun working with Python and Zope, and am interested, personally, in how they compare, too.

    Note: This is a repost. The original was modded 'Redundant' by somebody, but I'm not quite sure how the first post can be redundant, so I'm reposting

Say "twenty-three-skiddoo" to logout.

Working...