Java Ruby on Rails vs Grails vs. Spring ROO vs. Spring App
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2840890/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Ruby on Rails vs Grails vs. Spring ROO vs. Spring App
提问by Liz
I'm planning on writing a simple web application that will be used by lots of users (as complicated as a simple bookmarking app) and I'm trying to decide which framework/language to use.
我打算编写一个简单的 Web 应用程序,它将被很多用户使用(就像一个简单的书签应用程序一样复杂),我正在尝试决定使用哪种框架/语言。
I'm very experienced with Spring/Hibernate and Java in general but new to both Grails and RoR (and Spring ROO). The only reason I'm considering RoR is because Java hosting is MUCH more expensive than RoR hosting (which is supported by almost any hosting vendor for 5$ per month).
总的来说,我对 Spring/Hibernate 和 Java 非常有经验,但对 Grails 和 RoR(以及 Spring ROO)都很陌生。我考虑 RoR 的唯一原因是 Java 托管比 RoR 托管贵得多(几乎所有托管供应商都支持每月 5 美元)。
Assuming the price wasn't an issue, which one of the frameworks/languages mentioned above would you recommend for a Java developer (who knows how to configure Spring/Hibernate etc.)? I'm afraid that by using RoR I won't be able to easily support many users who are using the website at the same time.
假设价格不是问题,您会为 Java 开发人员(谁知道如何配置 Spring/Hibernate 等)推荐上面提到的哪一种框架/语言?恐怕通过使用 RoR,我将无法轻松支持同时使用该网站的许多用户。
thanks
谢谢
采纳答案by fabien7474
First you can have a look to these related questions :
首先你可以看看这些相关的问题:
Learning Ruby on Rails any good for Grails?
学习 Ruby on Rails 对 Grails 有好处吗?
Now, I will try to answer you according to your requirements you have communicated and the information I have gathered from the internet and my own experience.
现在,我将根据您所传达的要求以及我从网上收集的信息和我自己的经验,尽力为您解答。
Ruby on Rails
Ruby on Rails
I do not advice you to start with RoR because you are a Java developer and you will have to learn a new language (Ruby) and a new environment (Rails). The hosting issue is not a real issue. You can have a VPS hosting plan for $10 (www.enjoyvps.com) perfectly suited for small grails app. If you application needs more memory, you might need to add another 10 Bucks.
我不建议您从 RoR 开始,因为您是一名 Java 开发人员,您必须学习一门新语言 (Ruby) 和一个新环境 (Rails)。托管问题不是真正的问题。您可以花 10 美元 (www.enjoyvps.com) 拥有一个非常适合小型 grails 应用程序的 VPS 托管计划。如果您的应用程序需要更多内存,您可能需要再添加 10 美元。
If you hosting is really THE critical factor, go with Python/Django or PHP/Kohanna (a very good MVC framework). Otherwise, according to your background, Grails is more suited for you than Rails.
如果您的托管确实是关键因素,请使用 Python/Django 或 PHP/Kohanna(一个非常好的 MVC 框架)。否则,根据您的背景,Grails 比 Rails 更适合您。
Grails
圣杯
Few months ago, I had the same dilemma as yours and I decided to have my way with Grails. Why?
几个月前,我遇到了和你一样的困境,我决定用自己的方式使用 Grails。为什么?
Because it's cool !! I mean, community is very helpful and dynamic, Groovy is a pleasure to develop with (be careful : thereafter , there are good chances that you will loath Java). Also, it is a state-of-the-art framework based on very-well established technologies (Hibernate, Spring, Java) and hence, it can improve considerably your market value as a developer. Grails is my favorite
因为很酷!!我的意思是,社区非常有帮助且充满活力,Groovy 很高兴与它一起开发(请注意:此后,您很有可能会厌恶 Java)。此外,它是一个基于非常成熟的技术(Hibernate、Spring、Java)的最先进的框架,因此,它可以显着提高您作为开发人员的市场价值。Grails是我的最爱
Spring Roo
春之谷
Roo is Grails for Java. So if you don't want to learn Groovy and if you need pure Java application (that will always run faster than a Groovy-based app), go with it. The community is smaller than Grails but the project is supported by SpringSource who is quite active in the community. I think that if you want to go as fast as possible, this is the solution for you.
Roo 是用于 Java 的 Grails。因此,如果您不想学习 Groovy 并且需要纯 Java 应用程序(它总是比基于 Groovy 的应用程序运行得更快),那就去学习吧。社区比 Grails 小,但该项目得到了社区中非常活跃的 SpringSource 的支持。我认为,如果您想尽可能快地前进,这就是适合您的解决方案。
Spring Application
春季应用
You should choose this option only if you don't like Spring Roo integrated technologies (Hibernate, JSP, Maven...) and you want Java absolutely. Otherwise, there is no interest (except for educational purposes) of spending hours of configuration and tuning when you can build sophisticated enterprise applications in a best-practice manner within minutes (with Rails, Roo or Grails).
仅当您不喜欢 Spring Roo 集成技术(Hibernate、JSP、Maven...)并且绝对想要 Java 时才应该选择此选项。否则,当您可以在几分钟内(使用 Rails、Roo 或 Grails)以最佳实践方式构建复杂的企业应用程序时,就没有兴趣(除了教育目的)花费数小时的配置和调整。
Each of the options above will provide you enough performance for the application you want to build. A lot depends on best practices for website applications like good architecture design, correct usage of caching strategies and requests optimization...
上述每个选项都将为您要构建的应用程序提供足够的性能。在很大程度上取决于网站应用程序的最佳实践,例如良好的架构设计、缓存策略的正确使用和请求优化......
My Bottom Line
我的底线
If you have some time to spend for learning new concepts (Groovy, RAD...), go with Grails. If not, go with Roo. Forget about Spring App and Rails. If hosting is THE issue, so go with Python/Django. You can deploy on GAE, it's free scalable, performant and you will deal with the same concepts as Rails or Grails.
如果您有时间学习新概念(Groovy、RAD...),请使用 Grails。如果没有,就和罗一起去。忘记 Spring App 和 Rails。如果托管是问题,那么请使用 Python/Django。您可以在 GAE 上进行部署,它是免费的、可扩展的、高性能的,并且您将处理与 Rails 或 Grails 相同的概念。
回答by jdl
Performance issues with RoR are going to be caused more by the $5 hosting plan than by the choice of language and framework. Consider Herokufor your hosting, as you can start cheap / free, and then scale up as needed.
RoR 的性能问题更多是由 5 美元的托管计划而不是语言和框架的选择引起的。考虑将Heroku用于您的托管,因为您可以廉价/免费开始,然后根据需要进行扩展。
For a simple bookmark app, however, Rails is probably overkill. Take a look at the Sinatraframework as well, as you weigh your options.
然而,对于一个简单的书签应用程序,Rails 可能有点矫枉过正。在权衡选择时,也可以看看Sinatra框架。
回答by leebutts
Have you looked at Gaelyk? http://gaelyk.appspot.com/
你看过盖雷克吗?http://gaelyk.appspot.com/
It's a lightweight Groovy framework for Google App Engine
它是 Google App Engine 的轻量级 Groovy 框架
回答by tinny
I don't understand the obsession with runtime performance. Given your scenario your primary focus should be on yourperformance, as in your ability to get things done with the chosen technology.
我不明白对运行时性能的痴迷。鉴于您的场景,您的主要关注点应该是您的性能,就像您使用所选技术完成工作的能力一样。
You will get more done in a given period of time with Groovy than with Java any day. Often one line of Groovy code will equate to 10 lines of Java code etc etc
在给定的时间内,使用 Groovy 将比使用 Java 完成更多的工作。通常一行 Groovy 代码相当于 10 行 Java 代码等等
Very rarely will byte code execution time be your performance issue, most often its...
字节码执行时间很少会成为您的性能问题,最常见的是......
- Bad algorithm implementation or design.
- Bad DB design and / or queries
- Taking to long to get things done and then having all sorts of commercial relationship issues because of it.
- 糟糕的算法实现或设计。
- 糟糕的数据库设计和/或查询
- 需要很长时间才能完成工作,然后因此出现各种商业关系问题。
With web applications you are usually not performing lots of long running CPU bound operations. Most of your request / response time is spent in the wire (internet routing etc) and in the DB (executing queries).
对于 Web 应用程序,您通常不会执行大量长时间运行的 CPU 绑定操作。您的大部分请求/响应时间都花费在线路(互联网路由等)和数据库(执行查询)中。
Choose a technology that takes a load off your mind and one that frees you from writing mountains of boiler plate code, so that you can rather concentrate on designing and implementing good algorithms, DB's and queries etc etc
选择一种可以减轻您负担的技术,并且可以将您从编写大量样板代码中解放出来,这样您就可以专注于设计和实现好的算法、数据库和查询等
Id personally choose Grails.
我个人选择了 Grails。
回答by user452443
I chose Roo over Grails and Rails at my company. Runtime performance, easy debugging, nice Eclipse integration (it's plain old Java after all), no "black magic" happening at runtime. In fact, there is no Roo runtime library needed to run a Roo app, just the library dependencies like Hibernate and AspectJ. You can look at the code that is generated so you know exactly what is going on. Also a biggie for me is that Google has chosen Roo as the preferred tool for creating GWT apps going forward and they are throwing their support behind it. I have been extremely impressed with Roo thus far, I think it will be the tool of choice in the near future.
在我的公司,我选择了 Roo 而不是 Grails 和 Rails。运行时性能、易于调试、良好的 Eclipse 集成(毕竟它是普通的旧 Java),运行时没有“黑魔法”发生。事实上,运行 Roo 应用程序不需要 Roo 运行时库,只需要像 Hibernate 和 AspectJ 这样的库依赖项。您可以查看生成的代码,以便准确了解发生了什么。对我来说还有一个大问题是 Google 选择 Roo 作为未来创建 GWT 应用程序的首选工具,并且他们正在大力支持它。到目前为止,我对 Roo 印象非常深刻,我认为它会在不久的将来成为首选工具。
回答by LittleLebowski
I know this post is a bit old. It's 2012 now and Spring Roo just released version 1.2.2 3 months back.
我知道这个帖子有点旧。现在是 2012 年,Spring Roo 刚刚在 3 个月前发布了 1.2.2 版本。
我是一名 Java 开发人员,刚刚开始了一个雄心勃勃的项目,我将推出一个广泛采用的 Web 应用程序。我正在经历 Spring Roo,并且弄脏了我的手。我的第一印象很好,但是当我在 Internet 上读到它是用于快速原型设计并且仅用于开发 CRUD 操作等的良好框架时。我觉得使用它有点没有动力。但我个人认为 Spring Roo (SP) 使我的项目开始时采用了已通过选择创建的文件来实现的最佳实践,我可以将这些文件用作自定义使用的模板。显然,我不怕编码。我们将永远必须自己编码,我不想要任何“魔法”。我还试图环顾 RoR 场景,但很容易被所涉及的学习曲线吓倒。我在 Spring Roo 社区中没有看到太多的吸引力。有什么具体原因吗?还有没有更好的选择?我对最终确定一个既健壮又可扩展的框架的决定有些困惑。我不想成为 Twitter 现在 2 年价值的 RoR 代码让他们重新考虑他们对 RoR 的选择的位置。Spring Roo 对我来说是最好的选择吗?