Domain Objects and Services

前端 未结 4 1208
鱼传尺愫
鱼传尺愫 2020-12-12 14:20

In this question someone replies \"You never let the domain object implementations call services by themselves!\". Is this statement a hard fast rule of DDD or does it depen

4条回答
  •  再見小時候
    2020-12-12 14:32

    If you allow an Entity Object to call a service it is performing two roles Data Object and Service Object. Generally, each object should have on responsibility, not only in implementation but also in usage.

    In your case, the lowly UserImage seems to be both an Image and a ThumbPrint Recognizer.

提交回复
热议问题