是否有一个丰富的域模型的例子吗? [英] Is there a rich domain model example?
问题描述
我在寻找一个简单的例子来说明使用了丰富的域模型的好处。理想情况下,我的列表(这应该是尽可能短)前,后的代码一样。
I'm looking for a simple example to illustrate the benefits of using a rich domain model. Ideally, I'd like a before and after code listing (which should be as short as possible).
中的代码上市前应该显示问题使用贫血得到解决领域模型,以及大量的相当程序服务层的代码和后代码清单应该表现出同样的问题,用丰富的,面向对象的域模型得到解决。
The before code listing should show the problem being solved using an anemic domain model, and a lot of fairly procedural service-layer code, and the after code listing should show the same problem being solved using a rich, object-oriented domain model.
理想情况下,代码清单应该是用Java或Groovy,但任何事情非常相似(如C#)会怎么做。
Ideally the code listing should be in Java or Groovy, but anything fairly similar (e.g. C#) would do.
推荐答案
也许这吉米·博加德演示文稿包含你问什么
Perhaps this presentation by Jimmy Bogard contains what you ask for
的 https://github.com/jbogard/presentations/tree/master/WickedDomainModels
这篇关于是否有一个丰富的域模型的例子吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!