DDD和应用层 [英] DDD and application layer

查看:288
本文介绍了DDD和应用层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应用层(应用服务)是否在DDD中添加@Stateful,@Stateless,@WebService等?从下面的链接看来是对的。第二个问题:我已经创建了一个存储库类,所有涉及存储库的方法调用是否都会在应用程序服务中被写入?或者我可以直接使用存储库类来让JSF中的bean支持?什么时候和什么我放在应用程序层。我不明白EJB在这个艺术品中的属性。


应用层:此层协调应用程序活动。它不包含任何业务逻辑。它不具有业务对象的状态,但它可以保持应用程序任务的进度。


http://www.infoq.com/articles/ddd-in-practice

解决方案

Java EE倡导贫血模型,这与DDD相反。如果您想要DDD,您的实体也必须执行业务逻辑,这与服务层和实体的分离相反。


Is the application layer (application services) where I add @Stateful, @Stateless, @WebService etc. in DDD? From the link below this seems to be right.

Second question: I have made a repository class, should all method calls involving repository be wrappen in an application service? Or can I use repository classes directly in let say backing beans in JSF? When and what do I put in the application layer. I don't understand where the EJBs belong in this artitechture.

Application Layer: This layer coordinates the application activity. It doesn't contain any business logic. It does not hold the state of business objects, but it can hold the state of an application task's progress.

http://www.infoq.com/articles/ddd-in-practice

解决方案

Java EE advocates anemic model, which is the opposite of DDD. If you want DDD, your entities must also perform the business logic, which is contrary to the separation of service layer and entities.

这篇关于DDD和应用层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆