090614 T DDD与591jj

读了《DDDQ》的Service后,发现其理论与当初(大概200808-200812)设计591jj架构时的service竟不谋而合!其讲解简直就是591jj中service的全面解释!
DDDQ的主要内容第三章MDD,其所述知识,竟也和《PEAA》中的ORM理论大同小异。

所以若有人想自己学习591jj的架构时,可以推荐他们先看《DDDQ》及《PEAA》两本书。
    (虽然我当初设计其架构时,还没看《DDDQ》,《PEAA》也只看了部分,不过思想和他们的是相同的。)

反思,service的存在,只是因为系统中需要这个“职责”。而OO有“单一职责”原则,我们也可以理解为:有职责,就有类/对象。所以这个职责,就是service的存在意义!引用《DDDQ》中的话:
There are three characteristics of a Service:
1. The operation performed by the Service refers to a domain concept which does not naturally belong to an Entity or Value Object.
2. The operation performed refers to other objects in the domain.
3. The operation is stateless.

引用
《DDDQ》:      《Domain Drive Design Quickly》
《PEAA》:      《Patterns of Enterprise Application Architecture》

posted @ 2009-11-21 20:01  BloodyAngel  阅读(637)  评论(0编辑  收藏  举报