服务还是活动?
调用仅限内部的各种服务(即没有客户端代码可以调用逻辑)的最佳方法是什么?
IProcessService - 将运行各种事情并对域实体进行更改,但是当该域实体上的某些数据发生更改时,我们希望发送通知(向通知表添加新记录,记录当前用户和通知类型,也许甚至发送电子邮件)。
例如,添加客户,一旦我们添加客户 - 我们希望在数据库中保存已添加客户的记录,如果我们确认了供应商,我们确认了交货日期,我们想要触发通知。
我的通知是记录与订单流程相关的所有活动的一种方式...
使用发布订阅方法是否常见/事件列表器等?
注意:我正在使用 Linq To Sql 和服务层与我的 asp.net mvc 应用程序进行通信,我的所有业务逻辑/验证/规则等都驻留在我的服务层中...
What is the best way to go about calling various services that are internally only (i.e. no client code can invoke the logic)?
IProcessService - will run various things and make changes to a domain entity, however when certain data changes on this domain entity we want to send out a notification (add a new record to notification table, record the current user and type of notification, and maybe even send out email).
E.g. Add a client, as soon as we add a client - we want to save a record in the db that a client has been added, if we have a supplier confirmed, we have a delivery date confirmed we want to fire off notifications.
My notifications are a way of logging all activity related to the process of a Order...
Is using a pub sub approach common/ event listers etc?
NOTE: I am using Linq To Sql, and a service layer to communicate with my asp.net mvc app, all my business logic/validation/rules etc reside inside my service layer...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看域名活动。
当您调用
client.ConfirmDeliveryDate()
时,它将引发域事件 (DeliveryDateConfirmed
)。然后,您将有一个类侦听此事件:EmailCustomerWhenDeliveryDateConfirmed
。Check out Domain Events.
When you call
client.ConfirmDeliveryDate()
, it would raise a domain event (DeliveryDateConfirmed
). You'd then have a class listening to this event:EmailCustomerWhenDeliveryDateConfirmed
.