我正在寻找开发一个绿地web应用程序,它将重用许多Java组件.对我来说,显而易见的选择是Grails或jRuby on Rails,但我很难找到两者的客观比较.有没有明确的理由选择一个关于另一个:
易于与现有Java组件(在持久域之外)集成,例如JMS,EIP
支持功能测试框架
在一台机器上的性能
可扩展性
我不是在寻找有关开发人员或社区活动的答案.
(我检查了Grails vs. Rails,它与我无关)
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.
我非常了解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中编写性能关键部分.