Grails 值得吗? [英] Is Grails worth it?

查看:32
本文介绍了Grails 值得吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这一半是咆哮,一半是问题.

是否值得使用 Grails?我正在尝试开发一个相对简单的数据库驱动的 Web 应用程序.我的专长是 Java,因此 Grails 自然是一个不错的选择.一开始我想用Spring、JPA和Hibernate,但我以前用过,遇到了各种繁琐的配置和编码工作.Grails 标榜自己解决了这个问题.

我对 Grails 最大的挫折是所有的小事情都不起作用.我的意思是它并不像人们直觉上认为的那样工作.边缘非常粗糙.我经常遇到问题.有时是因为我缺乏对 Grails 的理解——有时我发现了合法的 Grails 错误.

一个主要问题是缺乏良好的 Eclipse 集成.有一个 Groovy 和 Grails 插件,但它除了语法高亮外没有其他作用.从 Java 调用 Groovy 反之亦然 配置.没有良好的 IDE 支持是一大遗憾.

结果是我坐下来尝试开发我的 Web 应用程序.一天结束时,我意识到我已经花了大约 85% 的一天时间调试与 Grails 相关的问题.如果不是 Eclipse 问题,则是 急切加载在视图中获取, 一对多关系奇怪的空文件错误行为一个奇怪的属性/getter 错误——它一直在继续.这只是我今天遇到的问题的一个示例.我与 Grails 的最后一次坐下来产生了一大堆不同的问题.

我有时想知道这是否值得.我很好奇其他人是否经历过这种情况.真的有人使用 Grails 来高效地开发 Web 应用程序吗?是否还有其他我应该考虑的用于快速 Web 开发的框架?

解决方案

我们有一个由 12 人组成的团队,他们都是从 0.6B 开始学习 Grails 的经验丰富的高级 Java 开发人员,而且我们仍在开发基于 Grails 的项目.我不会心甘情愿地回到 Java,我们都松了一口气,因为我们已经摆脱了如何使用 Grails 应用程序快速到达某个地方的问题.

这是一场斗争,这并不容易,并且有/正在沮丧.

尽管如此,鉴于我们的持续努力,我们还是很快交付了一些东西.存在错误,其中许多都有解决方法.

我听说过几个擅长 Java 的开发人员试图深入研究 Grails 项目的深入、复杂的咒语.我们避开了所有 Java,转而使用纯 Grails 和 Groovy.我们确保从简单开始,尽可能以可管理和实际可行的方式构建复杂性.我们不敢深入到最后,希望我们的 Java 知识足以支撑我们.

我们最终创造了一个巨大而复杂的东西,它工作得非常好,而且比编写纯 Java/Spring/Hibernate 版本快得多;那就是没有像样的 IDE 支持,而且在错误方面的情况比今天更糟糕.

关于 Eclipse 支持,用于 Grails/Groovy 的唯一真正的 IDE 是 Intellij - Eclipse 支持远远落后,遗憾的是:我是 Eclipse 爱好者并且远不是 Intellij 转换者 - Grails/Groovy 支持打击其他一切都消失了.

是的,与 Spring 相比,Grails 可能还不成熟.或休眠.我敢打赌,在它们存在的头 1.5 年里,它们同样充满了问题.

事实就是如此,你有责任注意将复杂性保持在最低限度,仔细测试优先(在我们看来)并逐渐小心地建立复杂性.

一旦在堆栈中包含 Spring/Hibernate,Java 就没有快速的代码解决方案.Grails 所体现的复杂性反映了 Spring/Hibernate 自身的复杂性.如果你觉得你的时间最好用纯 Java 来做,我不会反驳..我仍然有我的 WTF 但现在陡峭的学习曲线已经过去了,我想我会继续使用 Grails.

This is half rant, half question.

Is it worth using Grails? I'm trying to develop a relatively simple database-driven web application. My expertise is in Java, so naturally Grails seemed like a good choice. At first I thought of using Spring, JPA and Hibernate, but I’ve used that previously and have run into all sorts of tedious configuration and coding work. Grails advertises itself as solving this.

My biggest frustration with Grails is all of the little things that don't work. What I mean is that it doesn't work as one would intuitively think it should. It's very rough around the edges. I run into problems constantly. Sometimes it's my lack of Grails understanding — other times I've discovered legitimate Grails bugs.

One major issue is the lack of good Eclipse integration. There is a Groovy and Grails plugin, but it doesn't do much other than syntax highlighting. Calling Groovy from Java and vice versa is very painful to configure. Not having good IDE support is a major bummer.

What happens is I sit down trying to develop my web application. At the end of the day I realize that I've spent about 85% of the day debugging Grails-related issues. If it isn't Eclipse problems then it's eager loading, fetching in the view, one-to-many relationships, weird empty file bug behavior, a weird property/getter bug — it just goes on and on. This is just a sample of the issues I ran into today. My last sit-down with Grails yielded a whole bunch of different issues.

I sometimes wonder if it's worth it. I'm curious if others have experienced this. Are there people actually using Grails to productively crank out a web application? Are there other frameworks for rapid web development that I should be considering?

解决方案

We had a team of 12 people all seasoned senior Java devs who learnt Grails from 0.6B and we are all still working on projects based on Grails. I wouldn't go back to Java willingly, and we are all relieved to have broken the back of how to get somewhere quick with a Grails app.

It was a struggle, it was not easy and there was/is frustration.

Nevertheless we delivered something very quickly given our ongoing efforts.. There are bugs, many which have workarounds.

I have heard of several instances of developers who are good at Java trying to dive into deep, complex incantations of Grails projects. We eschewed all Java and went pure-Grails and Groovy. We made sure we started simple, built up the complexity as manageably and as practically as possible.. We dared not dive in the deepest end and hope that our Java knowledge was enough to carry us.

We had eventually created something huge and complex that worked fabulously and did so far faster than writing pure Java/Spring/Hibernate version; and thats without decent IDE support and a far worse situation in terms of bugs than today.

As regards Eclipse support, the only real IDE to use for Grails/Groovy is Intellij - the Eclipse support is way behind, sadly: I was an Eclipse lover and am far from being an Intellij convert - the Grails/Groovy support blow everything else away though.

Yes, Grails is immature compared to Spring perhaps. Or Hibernate. And I would wager that in the first 1.5 years of their existence they were equally as fraught with issue.

That being as it is, places the onus on you, to take care that you keep complexity to the absolute minimum, to carefully test-first (in our opinion) and build up to complexity gradually and with care.

There is no fast code solution with Java once you involve Spring/Hibernate in the stack. The complexity Grails embodies is a reflection of Spring's / Hibernate's own complexity. If you feel that you time is better spent doing it with pure Java, I wouldn't argue otherwise.. I still have my WTFs but now that the steep learning curve is behind me I think I will stick w Grails some more.

这篇关于Grails 值得吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆