`

What is Spring Roo?

阅读更多


Spring出来了一个叫做Roo的东东,一直没有时间去看看,引文Spring出品的东西一向来说,都是珍品诸多的,但从spring的官网上,居然没办法了解Roo到底是个什么玩意(投资放大了,但文档却做得越来越差了)。好在Roo实在是一个小玩意,下载还不到3M,于是马上下载下来,一读为快。

  • 下载
  • 解压
  • 运行 roo.bat 进入到roo shell,就可以一步一步的按照提示进行了。(这个做得不错,居然没有文档,也可以按照提示进行操作)
这里吧 roo 支持的命令一一列出来,各位看官可以对 roo 的功能有一个初步的了解:

* */ - End of block comment
* /* - Start of block comment
* // - Inline comment markers
* ; - Inline comment markers
* add dependency - Adds a new dependency to the Maven project object model (POM)
* add field boolean - Adds a private boolean field to an existing Java source file
* add field date jdk - Adds a private date field to an existing Java source file
* add field date jpa - Adds a private JPA-specific date field to an existing Java source file
* add field email template - insert a MailTemplate field into an existing type
* add field number - Adds a private numeric field to an existing Java source file
* add field reference jpa - Adds a private reference field to an existing Java source file (ie the 'many' side of a many-to-one)
* add field set jpa - Adds a private Set field to an existing Java source file (ie the 'one' side of a many-to-one)
* add field string - Adds a private string field to an existing Java source file
* configure email template - configure a template for a SimpleMailMessage
* configure logging - Configure logging in your project
* database properties - Shows database configuration details
* database remove - Removes a particular database property
* database set - Changes a particular database property
* date - Displays the local date and time
* development mode - Switches the system into development mode (greater diagnostic information)
* exit - Exits the shell
* generate class file - Creates a new Java source file in any project path
* help - Shows system help
* hint - Provides step-by-step hints and context-sensitive guidance
* insert field - Inserts a private field into the specified file
* install email provider - Install a Email provider in your project
* install finder - Install finders in the given target (must be an entity)
* install jms - Install a JMS provider in your project
* install security - Install Spring Security into your project
* install web flow - Install Spring Web Flow configuration artifacts into your project
* list finders for - List all finders for a given target (must be an entity
* metadata for id - Shows detailed information about the metadata item
* metadata for type - Shows detailed metadata for the indicated type
* metadata summary - Shows statistics on the metadata system
* metadata trace - Traces metadata event delivery notifications (0=none, 1=some, 2=all)
* new controller automatic - Create a new automatic Controller (ie where we maintain CRUD automatically)
* new controller manual - Create a new manual Controller (ie where you write the methods)
* new dod - Creates a new data on demand for the specified entity
* new integration test - Creates a new data on demand for the specified entity
* new java file - Creates a new Java source file in SRC_MAIN_JAVA
* new mock test - Creates a mock test for the specified entity
* new persistent class jpa - Creates a new JPA persistent entity in SRC_MAIN_JAVA
* new selenium test - Creates a new Selenium test for a particular controller
* new test file - Creates a new Java source file in SRC_TEST_JAVA
* property file details - Shows the details of a particular properties file
* property file remove - Removes a particular properties file property
* property file set - Changes a particular properties file property
* props - Shows the shell's properties
* quit - Exits the shell
* remove dependency - Removes an existing dependency from the Maven project object model (POM)
* script - Parses the specified resource file and executes its commands
* update jpa - Update the JPA persistence provider in your project
* version - Displays shell version

** Type 'hint' (without the quotes) and hit ENTER for step-by-step guidance **

我还没有对Roo进行深入的研究,初步的感觉是:
1、Roo的 TAB  做的真是很好,TAB在Bash中有一定的帮助作用,但仅限于有限的文件名自动完成,而Roo的命令行自动完成有点接近于IDE中的代码自动完成了。
2、Hint 做得也真好,居然,在没有文档和帮助的情况下,我可以(近乎)熟练的操作一个命令行工具。要记得,当初我学习Unix还是花了些功夫的。
3、最后的感觉是:Roo好像就是一个基于命令行的IDE,其功能无非就是一个IDE中会有的项目向导功能,包括命令行自动完成,也是IDE中的一些概念而已,本质上倒没有什么突破。而且,从实际投入而言,对于最终用户来说,一个命令行的Roo无论如何从使用便利性而言,是不如像eclipse之类的IDE的。不过,开发IDE所需时间、复杂度要大得多,Roo这种模式倒不失为一种IDE的快速开发原型吧。
4、Roo的本质是一个代码自动生成的工具,代码自动生产到底能够多大程度的应用到企业开发中,对项目开发效率能有多大提高,我觉得有些怀疑。作为教学用途,或者快速原型,倒是不错的选择。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics