responsibility

Interface with service layer or domain objects themselves? (DDD)

和自甴很熟 提交于 2020-01-12 08:29:16
问题 I'm still learning about DDD and I have these two (probably simple) questions: If a Factory creates new object/graph/aggregate instances, but also "reconstitutes" objects/graphs from the Repository, then: (1) Does your service layer functions/jobs/tasks/unit-of-work call into the Factory or a behavioural method on the Entity instance or a DomainService function? I'm lost as to the call stack based on the responsibility of these components. (2) Do Entity instances even have "behavioural

Whose responsibility is it to cache / memoize function results?

孤街浪徒 提交于 2019-12-09 16:41:11
问题 I'm working on software which allows the user to extend a system by implementing a set of interfaces. In order to test the viability of what we're doing, my company " eats its own dog food " by implementing all of our business logic in these classes in the exact same way a user would. We have some utility classes / methods that tie everything together and use the logic defined in the extendable classes. I want to cache the results of the user-defined functions. Where should I do this? Is it

Whose responsibility is it to cache / memoize function results?

跟風遠走 提交于 2019-12-04 05:01:46
I'm working on software which allows the user to extend a system by implementing a set of interfaces. In order to test the viability of what we're doing, my company " eats its own dog food " by implementing all of our business logic in these classes in the exact same way a user would. We have some utility classes / methods that tie everything together and use the logic defined in the extendable classes. I want to cache the results of the user-defined functions. Where should I do this? Is it the classes themselves? This seems like it can lead to a lot of code duplication. Is it the utilities

Interface with service layer or domain objects themselves? (DDD)

為{幸葍}努か 提交于 2019-12-03 16:47:42
I'm still learning about DDD and I have these two (probably simple) questions: If a Factory creates new object/graph/ aggregate instances, but also "reconstitutes" objects/graphs from the Repository , then: (1) Does your service layer functions/jobs/tasks/unit-of-work call into the Factory or a behavioural method on the Entity instance or a DomainService function? I'm lost as to the call stack based on the responsibility of these components. (2) Do Entity instances even have "behavioural methods" like above? For example does a Post have p.UpdatePost(string bodyText) or is that not a concern of