Java Swing 开发框架,Griffon 2.1.0 发布
Griffon 是Swing开发者的一个Groovy框架。Griffon期望提供一个稳定代码结构给Swing应用,就像Grails给web开发带来的优势一样。同 时,Griffon也可能提供一个替代应用框架,替代Spring RCP,Eclipse RCP和NetBeans平台。
Griffon 2.1.0 发布,主要改进如下:
* MVC 组管理改革
* 使用 ActionHandlers,Actions 可以在任意时间更新他们的属性
* 启动组可以提供插件
* 更新了 Lazybones 项目模板
* 更新了构建时和运行时依赖
详细内容如下:
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
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 | |
withMVCGroup | withMVC | void |
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.
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.
Addons
GriffonAddon
s 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.
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
-
the type implements a well known interface.
-
the type is a concrete class.
-
the type is a public, non-static class.
-
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.
Compatibility
Full binary compatibility report between Griffon 2.0.0 and 2.1.0 can be foundhere.
相关资讯
- Java Swing 开发框架,Griffon 2.1.0 发布
- Swing开发框架 Griffon 0.9.4 发布
- Swing开发框架,Griffon 0.9.5 发布
- 基于Groovy的Swing开发框架,Griffon 0.9.5-rc2 发布
- Swing应用程序开发框架 Griffon 0.9.3 发布
- 用 Groovy 开发 Swing 界面的框架,Griffon 0.9.5-rc1
- Griffon IDE 1.5.9 发布,编程开发IDE
- Griffon 1.0 正式发布,JVM 应用开发框架
- Griffon 1.1.0 发布,利用Groovy开发Java桌面应用
- IoC 框架,OfficeFloor 2.1.0 发布