CRUD:去 Roo 还是不去 Roo?
我一直在使用 Groovy on Rails 进行 CRUD 应用程序。我正在开始一个新项目,我们不再允许使用 Grails(我们有一个允许的 jars 和 grails 的列表) 不在那里)。
我正在考虑使用 Spring ROO 或 JBoss Seam。他们如何比较?他们的主要优点和缺点是什么?
I have been using Groovy on Rails for CRUD applications. I am starting a new project where we are not allowed to use Grails anymore (we have a list of allowed jars and grails
is not there).
I am considering using Spring ROO or JBoss Seam. How do they compare? What are their major strengths and weaknesses?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请注意,Spring Roo 和 JBoss Seam 不能直接比较,因为 JBoss Seam 本身不提供问题中提到的 CRUD 应用程序生成。然而,JBoss Seam 附带了 seam-gen 工具,它提供了此功能。因此,最好将 JBoss Seam 与 Spring 框架进行比较,并将 seam-gen 工具与 Spring Roo 进行比较。我知道这也不是完整的比较,但我想这超出了本主题的范围。需要说明的是,在下面的回答中,当我提到 JBoss Seam 时,我实际上指的是 JBoss Seam 与 seam-gen 工具的结合。
Spring Roo 和 JBoss Seam(带有 seam-gen) )使 CRUD 应用程序的创建变得非常容易,就像其他 Java 全栈/脚手架解决方案一样,例如 Play Framework 和 RIFE 也是如此。如果您比较两者(Spring ROO 和 JBoss Seam 以及 seam-gen)基于现有数据库或通过添加实体并定义字段和关系来启动和运行新的基本 CRUD 应用程序的速度,我想有没有那么大的区别。根据我的经验,您可以在 Spring Roo 中更快(稍微)一点,但是使用这两种方法,您可以在不到一个小时(如果是现有数据库)或不到(半)天(在如果您必须手动添加所有实体和关系)。
在继续之前,读者应该注意,整个比较是根据我对这两种解决方案的浅薄经验进行的,因此基于 Spring Roo 版本 1.1.0 和 JBoss Seam 1.2 和 2.x。读者还应该注意到,目前已经有一个基于 Java EE 6 规范的优秀 Seam 3 版本(实际上是带有 Seam 模块插件的 CDI(Weld)),但是这个新版本的 JBoss Seam 不再具有 Seam- gen 应用程序,因此尚不具备仅使用几个命令(如 Spring Roo 和 JBoss Seam 2.x 及更低版本)创建完整 CRUD 应用程序的功能。目前,JBoss 的一些人正在研究类似的东西,名为 JBoss Forge,它看起来非常有前途,但截至今天,还没有 Spring ROO 和 JBoss Seam(带有 seam-gen)都创建了一个不错的基本 CRUD 应用程序,
尽管 Spring Roo 生成的应用程序的默认 UI 设计看起来像以我的拙见,更好一点,但无论如何你可能都想重新设计它,所以这对任何一个都没有太大的争论。创建的 Web 应用程序在提供的功能上也略有不同,但就基本 CRUD 功能以及身份验证和国际化等其他基本功能而言,它们是相同的。
我认为主要的区别以及因此决定您想要选择哪个的原因不在于生成基本 CRUD 应用程序所需的时间,也不在于搭建的基本 CRUD 应用程序,而在于更重要的事情,例如架构/设计决策、使用、支持、文档、灵活性、可维护性、扩展点等。就我而言,Spring Roo 和 JBoss Seam 都是构建 Web 应用程序的绝佳选择(事实上,我的团队已经创建了生产应用程序与两者),但在做出决定之前,您必须查看这些重要差异并决定什么最适合您。当然,最好的决定方法是使用这两种选择为自己进行概念验证,但如果您没有时间和/或资源,这就是我可以想到的(从顶部开始)这是两者之间的差异,可能会帮助您决定采用哪种方式:
尽管这两个出色的产品之间当然存在更多差异,而且我什至还没有触及可测试性、学习曲线和这些项目的未来等重要内容,但我希望上述要点可能已经对正在考虑这两种解决方案的人们有所帮助,做出至少更有根据的决定。我想再次强调,做出决定的最佳方法仍然是使用这两种方法创建概念验证,然后看看哪一种最适合您。
以我的拙见,可能会让您轻松快速做出决定的要点是 Spring 堆栈或 Java EE 堆栈之间的选择、IDE 支持、Web 框架和解决方案的“成熟度”。因此,如果您非常熟悉 Spring 堆栈(我猜您是这样的,因为您来自 Grails),请选择 Spring Roo,否则您可能会浪费相当多的时间来熟悉 Java EE 堆栈,包括 JSF (当然,这确实取决于您的项目的大小,但假设它不是一个非常大的项目,那么学习新技术的影响对于单个项目来说可能太大)。如果您不能或不想使用 Eclipse 并且对此非常热衷,我想 JBoss Seam 可能是一个更好的解决方案。如果您想使用 JSF 或 Wicket,请选择 JBoss Seam,而如果您想使用 Spring MVC 或 GWT,请使用 Spring Roo(对于其他 Web 框架,您选择哪个可能并不重要,尽管 Spring roo 可能会是更好的解决方案)。如果“成年”是您的主要决定点,我想您最好使用 JBoss Seam。总而言之,在两者之间做出选择可能非常困难,但至少知道这两种解决方案都非常好,并且无论哪种方式都会对您有很大帮助。
顺便说一句,请务必关注 JBoss Forge 项目,因为当前的 Seam-Gen 解决方案将在不久的将来被这个有前途的项目所取代。
Note that Spring Roo and JBoss Seam aren't directly comparable, as JBoss Seam in itself doesn't provide the CRUD application generation mentioned in the question. JBoss Seam however comes with the seam-gen tool, which provides this functionality. It would therefore probably be better to see JBoss Seam as comparable to the Spring framework and compare the seam-gen tool with Spring Roo. I know this is also not a complete comparison, but that is outside of this topice I guess. What needs to be stated is that in the below answer, when I refer to JBoss Seam, I actually am referring to JBoss Seam in combination with the seam-gen tool.
Both Spring Roo and JBoss Seam (with seam-gen) make the creation of CRUD applications really easy, as by the way other Java full stack/scaffolding solutions like the Play Framework and RIFE also do. If you compare the two (Spring ROO and JBoss Seam with seam-gen) in how fast you have a new basic CRUD application up and running, based on an existing database or by adding entities and defining the fields and relationships, I guess there isn't that much of a difference. In my experience you can do it in Spring Roo just a (slightly) bit quicker, but with both you have the application up in less than an hour (in case of an existing database) or in less than (half) a day (in case you manually have to add all entities and relationships).
Before continuing, the reader should note that this whole comparison was made based on my humble experience with both solutions, and therefore is based on Spring Roo version 1.1.0 and JBoss Seam 1.2 and 2.x. The reader should also note that there is currently already an excellent Seam 3 version (actually CDI (Weld) with Seam module addons) wich is based on the Java EE 6 spec, but that this new version of JBoss Seam no longer has the seam-gen application and therefore hasn't yet the functionality to create a complete CRUD application with just a couple of commands like Spring Roo and JBoss Seam 2.x and lower have. There are currently people from JBoss working on something similar though, named JBoss Forge, which looks very promising but which, as of today, has not yet had any actual release and is therefore not yet an option I guess.
Both Spring ROO and JBoss Seam (with seam-gen) create a nice basic CRUD application, though the default UI design of the Spring Roo generated application looks a bit better in my humble opinion, but as you probably want to restyle it anyway, this isn't much of an argument for either one. The created web applications also differ slightly in offered functionality, but for as far as the basic CRUD functionality goes and other basic features like authentication and internationalisation, they are on a par with eachother.
I think the main differences and therefore the reasons to decide for which you want to go, aren't in the time it takes to generate a basic CRUD application nor in the scaffolded basic CRUD applications, but in far more important things like architecture/design decisions, usage, support, documentation, flexibility, maintainability, extension points etc. For as far as I'm concerned, both Spring Roo and JBoss Seam are great options to base your web application on (as a matter of fact my team has created production application with both), but before you make a decision, you have to look at these important differences and decide what works best for you. Of course the best way to decide, would be to do a proof-of-concept for yourself with both options, but if you don't have the time and/or resources, here is what I can come up with (from the top of my head) that are differences between the two and that might help you decide either way:
Though there are of course far more differences between these two great products and I haven't even touched important things like testability, learning curve and the future of these projects, I hope the above bullets might already help people who are considering these two solutions, to make an at least bit more founded decision. I like to stress again that the best way to make a decision is still to create a proof-of-concept with both these approaches and see which best suites you.
Main points, in my humble opinion, that might give you to an easy and quick decision are the choices between the Spring stack or the Java EE stack, IDE support, Web Framework and 'adulthood' of the solution. So if you are very familiar with the Spring stack (which I guess you are, seeing that you're coming from Grails), go for Spring Roo as else you might loose quite some time in getting familiar with the Java EE stack, including JSF (of course this does depend on the size of your project, but assuming it is not a very large project, the impact of learning new techniques might be too large for a single project). If you cannot or don't want to use Eclipse and are really passionate about this, I guess JBoss Seam might be a better solution. If you want to use JSF or Wicket, go for JBoss Seam, while if you want to use Spring MVC or GWT, use Spring Roo (for other web frameworks it probably doesn't really matter which you choose, though Spring roo might then be a better solution). And if 'adulthood' is your main point of decision, I guess you'd better use JBoss Seam. All in all deciding between the two can be really hard, but at least know that both solutions are really great and will help you a lot, either way.
By the way, make sure to keep an eye on the JBoss Forge project as the current seam-gen solution will be replaced in the near future with this promising project.
锻造它 -> http://forge.jboss.org
如果你是新手,只要坚持,你就会拥有一个 Web 应用程序、测试和安全。还有更多。
如果您了解 Java,您将拥有与上面相同的知识,以及如何制作优秀应用程序的惊人知识来源:Forge 生成的源代码和资源。您可以学到很多关于 Java EE(CDI、Validation、JSF)、maven、JPA、tiles、EJB...等等的知识。
Just Forge it -> http://forge.jboss.org
If you are a novice, you'll have a web application, with persistence, tests and security. And more.
If you know Java, you'll have the same as above plus an amazing source of knowledge of how to make good applications: the source code and resources generated by Forge. You can learn a lot about Java EE (CDI, Validation, JSF), maven, JPA, tiles, EJB... And many more.
就Roo吧。
如果您是新手,您将拥有一个具有持久性、测试性和安全性的 Web 应用程序。还有更多。
如果您了解 Java,您将拥有与上面相同的知识,以及如何制作优秀应用程序的惊人知识来源:Roo 生成的源代码和资源。你可以学到很多关于Spring(核心、安全、MVC)、maven、JPA、tiles、messagign...等等的知识。
Just Roo it.
If you are a novice, you'll have a web application, with persistence, tests and security. And more.
If you know Java, you'll have the same as above plus an amazing source of knowledge of how to make good applications: the source code and resources generated by Roo. You can learn a lot about Spring (core, security, MVC), maven, JPA, tiles, messagign... And many more.