Java Swing 开发框架,Griffon 2.1.0 发布

jopen 10年前

Griffon 是Swing开发者的一个Groovy框架。Griffon期望提供一个稳定代码结构给Swing应用,就像Grails给web开发带来的优势一样。同 时,Griffon也可能提供一个替代应用框架,替代Spring RCP,Eclipse RCP和NetBeans平台。

Griffon 2.1.0 发布,主要改进如下:

 * MVC 组管理改革
 * 使用 ActionHandlers,Actions 可以在任意时间更新他们的属性
 * 启动组可以提供插件
 * 更新了 Lazybones 项目模板
 * 更新了构建时和运行时依赖

griffon-banner-large.png
详细内容如下:

Griffon 2.1.0 Release Notes

Dependencies

The following dependencies have been upgraded

  • junit:junit:4.12

  • org.codehaus.groovy:groovy-all:2.3.8

  • com.jayway.awaitility:awaitility:1.6.3

  • com.jayway.awaitility:awaitility-groovy:1.6.3

</div>

Runtime

MVC

In previous versions instances of MVCGroup would let you create other MVCGroup instances, with no direct relationship between the two unless explicitly stated (via an additional argument Map). This is no longer the case.

Child groups may now have a direct relationship with the parent group that created them. The parentGroup property will be set to the correct MVCGroup instance in every group member that defines it. Fine grained parent properties matching each member (such as parentController, parentModel andparentView) will also be set automatically. There are 2 sample applications that demonstrate this new feature in action

MVCGroupManager added getter/finder methods for Controllers, Models and Views. Finder methods may return a null value if the matching artifact was not found. Getter methods on the other hand will throw a ArtifactNotFoundException if the artifact could not be found.

The MVCHandler interface has been altered to better handle MVCGroups. Methods that sport MVCGroup in their name work with instances (createMVCGroup and withMCGroup) ofMVCGroup, either they take such type as argument or return instances of it. In contrast, methods that only have MVC on their names (createMVC and withMC) work with individual MVC members, such as Controller, Model and View. The following table summarizes the changes

Old Name New Name Return Type Args

buildMVCGroup

createMVCGroup

MVCGroup


createMVCGroup

createMVC

List


withMVCGroup

withMVCGroup

void

MVCGroupFunction

withMVCGroup

withMVC

void

MVCFunction

Finally, base artifacts such as Services can no longer create new MVCGroups by themselves, as this capability has been removed from the base GriffonArtifact interface.

</div>

Actions

The ActionHandler interface supersedesActionInterceptor interface, as it delivers a much better abstraction for configuring, handling and updating actions an their properties.ActionManager also gained the capability to update an action or a set of actions.

</div>

Addons

GriffonAddons now have the capability of supplying startup groups. These groups are initialized during the STARTUP phase, right after the startup groups defined by the application.

</div> </div>

Buildtime

Types Metadata

The java.util.ServiceLoader class allows you to load instances of a particular type as long as it conforms to the following rules

  1. the type implements a well known interface.

  2. the type is a concrete class.

  3. the type is a public, non-static class.

  4. the type provides a no-args constructor.

However sometimes you’d need to load types in a similar fashion without being forced by the last 3 rules, that is, you may want to load a type that is an interface or that provides a constructor with one or more arguments. If you ever encounter this scenario then annotate the classes/interfaces with @TypeProviderFor and load them using ServiceLoaderUtils. For example the griffon-mybatis-plugin loads instances ofMybatisMapper using this mechanism.

</div> </div>

Compatibility

Full binary compatibility report between Griffon 2.0.0 and 2.1.0 can be foundhere.

</div> </div> </div>