问题描述
Grails vs Rails。哪个更好的支持?哪一个是开发中型应用程序的更好选择?最重要的是哪一个有更多的插件?解析方案
Grails vs Rails。哪个更好的支持?哪一个是开发中型应用程序的更好选择?最重要的是哪一个有更多的插件?解析方案
另外值得一提的是:这两个框架的设计理念有些不同当涉及到模型。 Grails更面向领域,而Rails更面向数据库。
在Rails中,您基本上首先定义表(包含字段名称及其具体信息)。然后,ActiveRecord会将它们映射到Ruby类或模型。
在Grails中,情况正好相反:从定义模型(Groovy类)开始,当您运行时,GORM(Grails ActiveRecord等价物)将创建相关的数据库和表格(或更新它们)。这也可能是为什么你在Grails中没有'迁移'的概念(尽管我认为它会在未来的某个版本中发布)。
我不知道一个是否比另一个更好。我想这取决于你的上下文。
这就是说,我仍然在想自己选择哪一个。正如汤姆所说,如果你依赖于Java,你仍然可以使用JRuby--所以Java重用不应该成为你的唯一标准。
Grails vs Rails. Which has better support? And which one is a better choice to develop medium size apps with? Most importantly which one has more plug-ins?
One other thing worth mentioning: the design philosophy of both framework is somewhat different when it comes to the model. Grails is more "domain-oriented" while Rails is more "database-oriented".
In Rails, you essentially start by defining your tables (with field names and their specifics). Then ActiveRecord will map them to Ruby classes or models.
In Grails, it's the reverse: you start by defining your models (Groovy classes) and when you hit run, GORM (Grails ActiveRecord equivalent) will create the related database and tables (or update them). Which may also be why you don't have the concept of 'migrations' in Grails (although I think it will come in some future release).
I don't know if one is better than the other. I guess it depends on your context.
This being said, I'm still myself wondering which one to choose. As Tom was saying, if you're dependent on Java you can still go for JRuby - so Java reuse shouldn't be your sole criterion.
这篇关于Rails或Grails?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!