jboss forge 与 spring roo 相比如何?
I've just found out Jboss Forge
I wonder how it compares with Spring Roo
Can anybody highlight the principal coincidences and differences of these two tools?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些工具的相似之处在于它们都是帮助设置和配置项目的命令行工具,并且都具有生成代码的能力。
然而,存在一些主要的设计差异:
1) Forge 被设计用于任何类型的 Maven 项目。 Roo 与 Spring 有着密切的联系。因为 Forge 更通用,所以您可以为项目中使用的任何类型的技术找到或编写插件。 Roo 也是如此,但只是 Spring 之上的技术。您可以说 Forge 是一个(更)通用的框架,用于构建在 Maven 项目上工作的插件,而 Roo (只是)一个 Spring 工具。
2)Roo也是一个编程框架,而不仅仅是一个工具。代码生成大量使用AspectJ,使代码生成对程序员来说几乎不可见,并提供了仅在基于动态语言的框架中才能找到的功能(例如实体上的动态查找方法)。这既可能是一件好事,也可能是一件坏事。它很好,因为它功能强大且更优雅,因为您“看不到”生成的代码。不好的一点是,它对 Roo 造成了巨大的锁定。这在技术上是不正确的,因为它只是“普通”AspectJ,但它与正常的 Java/Spring 代码相去甚远。 AspectJ 也不能在所有 IDE 中正常工作(Eclipse 和 IntelliJ 都可以)。由于这种编程模型,我永远不会使用 Roo。如果我想要一个具有动态语言功能的框架,我会使用 Grails,而不是半途而废。当然这只是我个人的看法。
Forge 中的代码生成更像是传统的代码生成,虽然有很多缺陷,但您永远不会陷入任何非标准的情况。内置代码生成基于普通 Java EE 6。
The tools are similar in the way that they are both command line tools that help setting up and configuring a project, and both have the ability to generate code.
There are some major design differences however:
1) Forge is designed to be used on any kind of Maven project. Roo is pretty much tied to Spring. Because Forge is more general you can find or write plugins for any kind of technology that you use in projects. This is also true for Roo, but only technology on top of Spring. You could say that Forge is a (more) generic framework for building plugins that work on Maven projects, while Roo is (just) a Spring tool.
2) Roo is also a programming framework, not only a tool. The code generation makes heavy use of AspectJ to make the code generation almost invisible to the programmer, and gives features that are otherwise only found in frameworks based on dynamic languages (e.g. dynamic finder methods on entities). This can be both a good and a bad thing. It's good because it's powerful and more elegant because you don't "see" the generated code. The bad point is that it gives a massive lock-in on Roo. This is technically not true, because it's just "plain" AspectJ, but it's far from normal Java/Spring code. AspectJ also doesn't work well in all IDEs (Eclipse and IntelliJ are fine). Because of this programming model I would never use Roo. If I want a framework with dynamic language features I use Grails, not something halfway there. Of course this is just my personal opinion.
Code generation in Forge is more of the traditional kind, with all it's flaws, but you will never lock into anything non-standard. The built-in code generation is based on plain Java EE 6.