开发者

Accessing interfaceof model service in model entity

开发者 https://www.devze.com 2023-01-31 00:02 出处:网络
Can i access model service through model entity by usinginterface ofmodel service. I know that we can access entity from model service, but vice versa though model ser开发者_开发技巧vice interface is

Can i access model service through model entity by using interface of model service.

I know that we can access entity from model service, but vice versa though model ser开发者_开发技巧vice interface is it possible.


You can. It's certainly better than writing more procedural code - working with entities instead of letting them to work themselves.

But I agree with Szymon Pobiega on this:

My own rule of thumb is use Domain Events (as desscribed by Udi) as a preferred way of IoC when interaction can be made one-way. If it can't, I use double dispatch.

0

精彩评论

暂无评论...
验证码 换一张
取 消