声明:JavaEye新闻文章的版权属于JavaEye网站所有,严禁任何网站转载本文,否则必将追究法律责任!
Groovy是Java平台的动态脚本语言,语法非常近似Java的语法,但是借鉴了来自smalltalk,python和ruby的语法,让你能够在利用Java平台所有类库,使用熟悉的Java语法的情况下,充分享受动态语言带来的各种便利。Groovy可以被嵌入到Java应用服务器当中,也可以被像spring和hibernate这样的开源框架用来描述配置信息,另外groovy特别适合于在企业应用系统当中用来描述业务规则,创建相应的领域专用语言(Domain-Specific Languages)。
Groovy 1.5版本主要提供了很多来自Java 5.0新的语法特性的支持,例如groovy支持annotation,泛型,静态导入和枚举类型,所以像一些使用了Java 5.0新语法的框架例如Spring2.5和JBoss Seam也可以扩展groovy支持,来处理带有类型定义的集合。
groovy 1.5的其他新特性还包括:
一、支持元编程的能力,这一功能是Grails项目组贡献的代码
二、增强了Java/Groovy编译器,让你能够把groovy代码和Java的class混合和匹配在同一编译步骤当中。
三、提供了类似Javadoc的GroovyDoc工具,让你可以方便的读取groovy代码生成Groovy API文档。
四、重写过的交互式shell工具能够提供命令补齐功能。
五、Groovy的Swing console功能也得到了增强。
除此之外,各个Java IDE也正在提供对于Groovy的良好支持,其中IDEA最棒,已经可以提供如下编辑支持:
1、语法高亮
2、代码自动补齐
3、脚本和单元测试集成运行环境
4、调试器
5、语法重构功能!
除此之外,Eclipse的Groovy插件和NetBeans的Groovy插件也在开发过程当中。
总体来说,Groovy的前景还是比较看好的,原生的java平台脚本语言,良好的IDE支持,开源框架支持都是它的优势,当然Groovy背后不光有一个开发团队,还有一家商业公司G2One的支持,也会让Groovy的开发获得良好的推动力
Groovy 1.5版本主要提供了很多来自Java 5.0新的语法特性的支持,例如groovy支持annotation,泛型,静态导入和枚举类型,所以像一些使用了Java 5.0新语法的框架例如Spring2.5和JBoss Seam也可以扩展groovy支持,来处理带有类型定义的集合。
groovy 1.5的其他新特性还包括:
一、支持元编程的能力,这一功能是Grails项目组贡献的代码
二、增强了Java/Groovy编译器,让你能够把groovy代码和Java的class混合和匹配在同一编译步骤当中。
三、提供了类似Javadoc的GroovyDoc工具,让你可以方便的读取groovy代码生成Groovy API文档。
四、重写过的交互式shell工具能够提供命令补齐功能。
五、Groovy的Swing console功能也得到了增强。
除此之外,各个Java IDE也正在提供对于Groovy的良好支持,其中IDEA最棒,已经可以提供如下编辑支持:
1、语法高亮
2、代码自动补齐
3、脚本和单元测试集成运行环境
4、调试器
5、语法重构功能!
除此之外,Eclipse的Groovy插件和NetBeans的Groovy插件也在开发过程当中。
总体来说,Groovy的前景还是比较看好的,原生的java平台脚本语言,良好的IDE支持,开源框架支持都是它的优势,当然Groovy背后不光有一个开发团队,还有一家商业公司G2One的支持,也会让Groovy的开发获得良好的推动力


评论 共 3 条 发表评论
shiren1118 2007-12-10 08:40 引用
* IBM: Eclipse plugin improvements and upgrade to support this latest version of the language,
* Oracle: JMX support improvements to call remote beans as if they were local,
* Sun: Rooms for our developer meetings, and a wonderful 8-core 8-CPU machine for our high-load concurrency testing,
* JetBrains: for the joint java/groovy compiler & their awesome plugin,
* JBoss: for their help on ironing out our support for annotations and generics.
shiren1118 2007-12-10 08:40 引用
Groovy is a dynamic language for the JVM that integrates seamlessly with the Java platform. It offers a Java-like syntax, with language features inspired by Smalltalk, Python or Ruby, and lets your reuse all your Java libraries and protect the investment you made in Java skills, tools or application servers. Groovy can be used for various purposes, from adhoc shell scripting leveraging Java APIs, to full-blown web applications built on Spring and Hibernate through the Grails web framework. It can also be integrated very easily in your applications to externalize business logic, create Domain-Specific Languages, or to provide templating, XML parsing capabilities, and much more.
This major release integrates features offered by Java 5: annotations, generics, static imports and enums, making Groovy the sole alternative dynamic language for the JVM that lets you leverage frameworks that use annotations like Spring's @Transactional or JBoss SEAM which both provide extended Groovy support, or generics to help JPA or Hibernate properly handle typed collections.
In this release, new meta-programming capabilities have been contributed thanks to the work of the Grails project developers, pursueing our symbiotic relationship. A few syntax enhancements have also found their way into it to help ease the development of Domain-Specific Languages. A great attention to performance improvements made this new version much snappier than before, as witnessed by a reports we had by teams working on mission-critical applications using Groovy as a business language.
Since Groovy 1.0, the team also worked on improving the tool chain by creating a joint Java / Groovy compiler to let you mix and match Groovy and Java classes in the same compilation step. A GroovyDoc equivalent to JavaDoc lets you document your Groovy classes. The rewritten interactive shell is now really interactive and provides useful command completions for making you more productive, and the Groovy Swing console has also been improved thanks to our talented Swing team and the help of Swing expert Romain Guy.
Apart from improvements or the creation of these new tools, you should have a look at JetBrains' JetGroovy, a fantastic Groovy and Grails plugin which provides advanced coding capabilities to IntelliJ IDEA:
* syntax highlighting,
* code completion,
* scripts and unit tests running ability,
* debugging capabilities,
* and even refactorings!
Of course, if you're an Eclipse user, you can still use the Groovy Eclipse plugin, or Sun's work in progress NetBeans plugin for Groovy and Grails.
An upcoming article on InfoQ that will be published in the following days will detail the novelties of this new version in more depth. So, please stay tuned!
In the meantime, you can listen to the interview of Groovy Project Manager and G2One VP Technology Guillaume Laforge that was recorded at QCon 2007, in March, in London, or read G2One's team interview at JavaLobby.
I would like to thank everybody who was involved in this release in a way or another: the Groovy developers for their hard work, patch and documentation contributors, users reporting bugs or requesting new features or improvements, book authors.
Several well-known companies have put great efforts in helping us making Groovy what it is today:
* IBM: Eclipse plugin improvements and upgrade to support this latest version of the language,
* Oracle: JMX support improvements to call remote beans as if they were local,
* Sun: Rooms for our developer meetings, and a wonderful 8-core 8-CPU machine for our high-load concurrency testing,
* JetBrains: for the joint java/groovy compiler & their awesome plugin,
* JBoss: for their help on ironing out our support for annotations and generics.
It would be impossible to list everybody, but you're all part of this effort, and you made the success of Groovy and the quality of this new milestone. Thanks and well done to you all!
You can read the detailed JIRA release notes of the changes since the last release candidate.
And now, just download Groovy 1.5 and give it a try: http://groovy.codehaus.org/Download
-
Guillaume Laforge
Groovy Project Manager
Vice-President Technology at G2One, Inc.
LostJava 2007-12-09 18:53 引用