JdonFramework-6.6.6新版本发布

JdonFramework-6.6.6版本在原来成熟稳定的6.6.4版本上主要增加了对CQRS的command异步并发支持。

也就是说,原来聚合根实体模型发出的领域事件是通过异步并发的Disruptor输出,6.6.6版本增加了使用Disruptor进行异步并发的command输入,这样聚合根实体模型有自己的与外界进行异步无堵塞的输入输出通讯,更加完整,更类似Scala/Akka Erlang的Actors模型了。如下图:

关于Actors模型的好处见文章:http://www.jdon.com/45728

在Jdon框架中有两个模型: Component(组件) 和 Model(领域模型). 分别以@Component, 和 @Model 标注。

当一个Model被外部组件访问,它一般是DDD中的聚合根实体,因为根据DDD只有聚合根实体才能被外界访问引用,外部不能直接访问聚合边界内其它对象,必须通过聚合根,这样聚合根才能保证聚合边界内各个对象变化的一致性。

如果一个Model被其他领域模型引用,它就肯定不是聚合根,因为聚合根之间不能直接相互引用,它可能是聚合内一个对象,或者是实体或者是值对象。

领域模型Model实例生活在in-memory内存缓存中, 而组件Component实例的生命周期是应用级别,比如和Web容器相同,一个容器内缺省是一个单例。

Component能够用来实现DDD的服务service或其他应用管理器,如邮件发送等。

Jdon框架也提供一种类似Component的Service类型 (标注为@Service),它是面向外部客户端,而不是面向内部,可用来实现SOA的粗粒度大服务。

Jdon在这两个模型(Component和Model)之间提供四种异步并发的通讯方式,也是一种Producer/Consumer模式。

  1.组件和模型 Component -----> model

  2. 模型和组件 model ------->Component

  3. 组件与组件 Compponent ------> Component

  4. 模型与模型 model------> model

当一个组件或服务Component/Service发送消息给领域模型Model(也就是聚合根aggregate root), 在CQRS中我们称这个消息携带的是命令command, 当一个领域模型model发送消息给组件Component, 我们称它为事件,代表已经在领域模型中发生什么事情::

关于这四个方式如何具体实现,可见:http://www.jdon.com/jdonframework/cqrs.html

另外推荐道友@tangxuehua 的在.net上实现的CQRS框架:enode框架,两者可合并一起参考: http://www.cnblogs.com/netfocus/p/3179060.html
[该贴被banq于2013-09-24 07:56修改过]

好啊,前段时间看了tangxuehua的enode的思想,很有兴趣,可惜他的代码是net的,有些看不明白。这回看java的了。

有实例吗?原来jdon这个网站是JdonFramework的一个实例,但是JdonFramework更新的比jdon快,一些新的东西看不到有实例。

http://www.jdon.com/jdonframework/cqrs.html点击进去有实例,针对模型和组件的调用关系举例,也可下载: http://sourceforge.net/projects/jdon/files/JdonFramework-App/samples-6.6/

Jdon框架的英文发布进入Dzone的Big Link排名,说明这是大家关注的热点技术,今天收到dzone的系统来信:Your link titled 'Java Actors Model for CQRS/DDD' was a DZone Big Link on 09/26. Click here to view your link:
http://www.dzone.com/links/java_actors_model_for_cqrsddd.html

let's go reactive:
@寻找一个苹果
中间件江湖新来了一批悍将,在互联网领域把EE打得节节败退。Finagle(Twitter)异步化RPC,Akka(TypeSafe)融入管理思路的Actor模型,RxJava(Netflix)观察模式推送多个结果,Vertx(Eclipse)吸取Nodejs精华。它们身着黑衣,上书大大的"Reactive"。并且结党签署投名状 : http://www.reactivemanifesto.org/
[该贴被banq于2013-09-29 10:49修改过]

还没有发布吧?我用maven下不来jdonframework的6.6.6的版本。

2013-09-29 13:56 "@masterice
"的内容
我用maven下不来Jdonframework的6.6.6的版本 ...

应该可以啊:

<dependency>
<groupId>org.jdon</groupId>
<artifactId>jdonframework</artifactId>
<version>6.6.6</version>
</dependency>

注意,是org.jdon 不是com.jdon

真心不行,我以前没用过maven,可能是我的问题?
<!-- jdon lib start -->
<dependency>
<groupId>org.jdon</groupId>
<artifactId>jdonframework</artifactId>
<version>6.6.6</version>
</dependency>
错误:Missing artifact org.jdon:jdonframework:jar:6.6.6

2013-09-29 14:21 "@masterice
"的内容
Missing artifact org.jdon:jdonframework:jar:6.6.6 ...

居然是我没有发布成功,但是我本地仓库已经有了,重新发布到Maven中央仓库,大概明天才可以下,抱歉了。

多谢板桥~

6.6.6发布时出问题,不能修改了,只能使用6.6.8,现在可以下载了
如下配置:

<dependency>
<groupId>org.jdon</groupId>
<artifactId>jdonframework</artifactId>
<version>6.6.8</version>

现在我死活配不好maven了,抓狂了。板桥老师,救命~
我用的eclipse-jee-kepler-SR1-win32。然后安装maven插件,从这个地址下的:http://download.eclipse.org/technology/m2e/releases
安装完后创建maven工程就报错:一大串
错误1:
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (execution: default-compile, phase: compile) pom.xml /b line 1 Maven Project Build Lifecycle Mapping Problem
错误2:
CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Could not transfer artifact org.codehaus.plexus:plexus-utils:jar:1.4.1 from/to central (http://repo.maven.apache.org/maven2): null to http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.4.1/plexus-utils-1.4.1.jar pom.xml /b line 1 Maven Project Build Lifecycle Mapping Problem
错误3:
Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): null to http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom pom.xml /b line 1 Maven Configuration Problem
错误4:
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (execution: default-testCompile, phase: test-compile) pom.xml /b line 1 Maven Project Build Lifecycle Mapping Problem
错误5:
CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 (): ArtifactDescriptorException: Failed to read artifact descriptor for commons-cli:commons-cli:jar:1.0: ArtifactResolutionException: Could not transfer artifact commons-cli:commons-cli:pom:1.0 from/to central (http://repo.maven.apache.org/maven2): null to http://repo.maven.apache.org/maven2/commons-cli/commons-cli/1.0/commons-cli-1.0.pom pom.xml /b line 1 Maven Project Build Lifecycle Mapping Problem

2013-09-30 11:33 "@masterice
"的内容
我用的eclipse-jee-kepler-SR1-win32 ...

juno和kepler的java与JEE版本缺省带Maven支持,无需再安装。

好使了,有个plugin不好使,重新下载的~折腾一天,呵呵。
10.1开始学习~多谢板桥