Domain Driven Design and the role of the factory class

后端 未结 6 1805
温柔的废话
温柔的废话 2021-01-29 18:33

I\'am unclear as to what the roles and responsibility of the factory class is. I know enough that the factory class should be resposible for the creation of domain objects (agg

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-29 19:05

    I see Application Services layer having responsibility for creating new entities, by calling a factory to do so. Hence, entity factory interface is defined in Application Service module, and the actual implementation is an infrastructure service, in the same way that persistence is. For a nice clear idea on general application service vs domain service vs infrastructure services, I gained a lot of clarity by watching this: Bob Martin Ruby Midwest 2011

提交回复
热议问题