当前位置:  开发笔记 > 编程语言 > 正文

jRuby on Rails vs Grails

如何解决《jRubyonRailsvsGrails》经验,为你挑选了2个好方法。

我正在寻找开发一个绿地web应用程序,它将重用许多Java组件.对我来说,显而易见的选择是Grails或jRuby on Rails,但我很难找到两者的客观比较.有没有明确的理由选择一个关于另一个:

    易于与现有Java组件(在持久域之外)集成,例如JMS,EIP

    支持功能测试框架

    在一台机器上的性能

    可扩展性

不是在寻找有关开发人员或社区活动的答案.


(我检查了Grails vs. Rails,它与我无关)



1> Nick Sieger..:

Try both, and pick the language and environment that suits you best. It's true that the Grails stack out of the box is more suited towards Java integration, but many components are just a few lines of Ruby code away from integration with Rails. Rails 3 is a great release that doesn't require you to use ActiveRecord, in fact it would be trivial to use Hibernate for your models instead. See also DataMapper, MongoMapper and a whole host of database adapters for SQL and NoSQL databases alike.

Also, JUnit != functional testing. Instead, have a look at Cucumber + Cucumber-Rails + Capybara + Selenium for an integrated browser automation testing experience. Take a look at https://github.com/elabs/front_end_testing for an example application that demonstrates this stack.

I'll suggest that Ruby is better suited as a web integration language, and JRuby hits the sweet spot of making integration with Java easy as well as pleasing while making a wealth of non-Java libraries available to you. Don't think that Groovy automatically wins because it's "closer" to Java. Sometimes you need to step into a refreshingly different environment in order to have a new look at how to solve a problem.

Disclosure: as a member of the JRuby team my bias is evident in my answer.


哇,15赞成(直到现在)?!为了什么? - 提问者指定了四个标准,可以使答案成为解决方案. - 但是,您只响应其中一个(功能测试). - 如何整合像JMS这样的Java企业技术(这是问题中的要求)?最有可能的是,从JRuby到那些距离很远.

2> Erich Kitzmu..:

我非常了解Grails(现在我正在研究Grails项目),但不是JRuby,所以把这看作是一个可能有偏见的观点:看看JRuby文档,看起来JRubys与Java的集成有点麻烦,因为Java在Groovy中比在Ruby中更本地化; 因此,在JRuby中,你有很多特定的Java的关键字和方法(例如java_import,java_send).简而言之,Groovy是一种专门针对Java世界的语言,而JRuby就是将Ruby放在JVM上.

Grails内置了JUnit测试.

不能说性能和可伸缩性,但考虑到与Java的良好集成,当Groovy太慢时,总是可以在Java中编写性能关键部分.

推荐阅读
贾志军
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有