我在DDD中添加@Stateful、@Stateless、@WebService等的是应用层(应用服务)吗?从下面的链接来看,这似乎是正确的。
第二个问题:我做了一个repository类,所有涉及到repository的方法调用都应该封装在一个应用服务中吗?或者我可以直接在 JSF 的支持 bean 中使用存储库类吗?我什么时候在应用层放什么?我不明白 EJB 在这个艺术中属于什么地方。
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.
最佳答案
Java EE提倡贫血模型,与DDD相反。如果你想要 DDD,你的实体也必须执行业务逻辑,这与服务层和实体的分离背道而驰。
关于java - DDD和应用层,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9324248/