Ruby on Rails 和 Grails 有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2376646/
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
What is the difference between Ruby on Rails and Grails?
提问by l--''''''---------''''''''''''
Someone asked me to learn Grails and then they said Ruby on Rails. They almost used it interchangeably.
有人让我学习 Grails,然后他们说 Ruby on Rails。他们几乎可以互换使用它。
What is the difference between the two?
两者有什么区别?
回答by vidur punj
I have worked on both Groovy on Grails and Ruby on Rails.
我曾在 Grails 上的 Groovy 和 Ruby on Rails 上工作过。
- Both are agile platforms and follow the DRY or 'don't repeat yourself' principle.
- Both Grails is a framework of frameworks. You can write Java or Ruby syntax code in place of Groovy syntax code it will work perfectly.
- In Groovy we can use Java Spring and Hibernate frameworks too.
- Both support scaffolding.
- Rails has gems and plugins but in Grails, till now, I have used only plugins.
- Rails framework is built in Ruby language and Grails framework is built in Groovy language.
- 两者都是敏捷平台,都遵循 DRY 或“不要重复自己”的原则。
- Grails 都是一个框架框架。您可以编写 Java 或 Ruby 语法代码来代替 Groovy 语法代码,它会完美运行。
- 在 Groovy 中,我们也可以使用 Java Spring 和 Hibernate 框架。
- 两者都支持脚手架。
- Rails 有 gems 和插件,但在 Grails 中,到目前为止,我只使用了插件。
- Rails 框架是用 Ruby 语言构建的,Grails 框架是用 Groovy 语言构建的。
Both are wonderful frameworks.
两者都是很棒的框架。
You can find documentaion here:
你可以在这里找到文档:
回答by Brian
They are completely different technologies sharing a name pattern (e.g. Java and JavaScript). It was smart at the time to name the web framework built using Groovy "Groovy on Rails" (later asked to change its name) to get attention in a space saturated with web frameworks. One key fundamental difference (besides different programming languages) is the use of ActiveRecordin Rails versus Hibernate in Grails.
它们是完全不同的技术,共享一个名称模式(例如 Java 和 JavaScript)。当时将使用 Groovy 构建的 Web 框架命名为“Groovy on Rails”(后来被要求更改名称)是明智的,以在 Web 框架饱和的空间中引起注意。一个关键的根本区别(除了不同的编程语言)是在 Rails 中使用ActiveRecord与在 Grails 中使用Hibernate。
Grails embraces the convention over configurationapproach first popularized by Rails.
Grails 接受了首先由 Rails 推广的约定优于配置的方法。
回答by David Johnstone
Grails, formerly known as "Groovy on Rails", is a web app framework using the programming language Groovy. Ruby on Railsis very similar, but uses Ruby. (Note: I have no experience with either framework or language.)
Grails,以前称为“Groovy on Rails”,是一个使用编程语言Groovy的 Web 应用程序框架。Ruby on Rails非常相似,但使用Ruby。(注意:我对框架或语言都没有经验。)
Hereis a discussion about the two. Googlecan provide you with many more comparisons.
回答by Zak
Ruby on Rails is a web framework written in the Ruby language making use of the model-view-controller pattern and object-relational mapping. It has an emphasis on convention over configuration and a lack of repetitive code.
Ruby on Rails 是一个用 Ruby 语言编写的 Web 框架,它利用了模型-视图-控制器模式和对象-关系映射。它强调约定优于配置,并且没有重复的代码。
Grails is a framework for the Groovy programming language with similar goals.
Grails 是具有类似目标的 Groovy 编程语言框架。
回答by Ganesh Shankar
I haven't worked with Grails but it seems to be a framework for Groovy which is similar in nature to Ruby on Rails (except that the RoR framework is built on Ruby...)
我没有使用过 Grails,但它似乎是 Groovy 的框架,本质上与 Ruby on Rails 相似(除了 RoR 框架是基于 Ruby 构建的……)
See these Wikipedia articles for more info:
有关更多信息,请参阅这些维基百科文章:
http://en.wikipedia.org/wiki/Ruby_on_Rails
http://en.wikipedia.org/wiki/Ruby_on_Rails
回答by cinny savitri
Grails uses Groovy which in turn is based on Java whereas Ruby on Rails is based on Ruby which is a scripting language.
Grails 使用基于 Java 的 Groovy,而 Ruby on Rails 则基于 Ruby,后者是一种脚本语言。

