欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  资讯频道

Grails 1.0.3发布

程序员文章站 2022-04-14 22:57:58
...
本文由agile_boy 和 Eastsun 共同发布 

Grails 1.0.3于近日发布,该版本除了一些功能增强和修正bug外,还包含一些新的特性(对Grails不熟,就不翻译了:-)):

Interactive Mode
  An experiment feature in this release, interactive mode lets you load up Grails command line interface and keep it running simply by typing:
  grails interactive
  The advantage here is you don't suffer the additional JVM start-up cost and the JVM can start to inline code resulting in the ability to run the commands faster. This is particularily advantageous for testing with the unit tests running much quicker than before

Enum support in GORM
  GORM now supports JDK 1.5 enums which allows for type safe, enumerated types. For example:
  
enum VehicleStatus { OFF, IDLING, ACCELERATING, DECELARATING }  class Vehicle {
     Long id
     Long version
     VehicleStatus status
  }


I18n URL mappings
  You can now use URL mappings to map URLs onto particular languages extending Grails i18n support. For example:
"/german/$controller/$action" {
     lang = "de"
}



agile_boy 写道:


  现在想想Grails1.0.2发布也有些许时间了,其间Groovy倒是在性能优化方面做了很多改进,现在Grails1.0.3终于发布了,虽然没有在性能方面做特殊调整,但在bug修复和特性开发还是有改进的。
 
  下边就摘录一下Grails1.0.3的ReleaseNotes。
  从Grails1.0发布以来,下载次数达186000,平均下来50000次/月,插件的数量也大大增加,目前为止有70个之多,范围涉及到安全,RIA,WebService等等。最新1.0.3的文档也做出了更新(看来中文文档也要抓紧时间同步到1.0.3了Grails 1.0.3发布)

  下面看看新特性:

Interactive Mode

要执行Interactive Mode只需要键入:
grails interactive

此特性的主要目的是加快启动,尤其在测试的时候,你会明显感觉比原来快!

Enum support in GORM

GORM终于支持JDK5的Enum了,示例如下:
enum VehicleStatus { OFF, IDLING, ACCELERATING, DECELARATING }

class Vehicle { Long id Long version VehicleStatus status }


I18n URL mappings

看来Grails在I18n方面做的越来越人性化了,现在只需要在URL mapping中就可以轻松指定了,示例如下:
"/german/$controller/$action" {
     lang = "de"
}

Upgrade notes

升级的命令还是老样子,只需键入:
grails upgrade

但是后台还是改变了不少:
  • 开发环境的缓存现在已经改成了OSCache,但是生产环境的依旧是Ehcache
  • WebTest插件将升级成0.5版本

相关标签: Grails