后端向所有连接的客户端引发 (INotify)PropertyChanged 事件?
我们的一位“前端”开发人员不断要求我们后端开发人员要求后端通知所有连接的客户端(它是客户端/服务器环境)对象的更改。例如:每当一个用户进行更改时,所有其他连接的客户端都必须立即收到更改通知。
目前我们的架构没有这种类型的通知系统,并且我们没有一种用于显式选择对象的发布/订阅模型(例如前端当前正在实现的对象)..这在这样的情况下是有意义的恕我直言,但显然需要额外的实现。
但是,我认为前端通常会检查同一对象上同时存在的用户更改的锁,而不是在后台按需拉取更改/加载,而不是后端不断地将所有更改推送到所有对象的所有客户端..这看起来相当对我来说太过分了。
然而,有人认为,例如,MS 实体框架实际上不仅针对本地更改,而且针对包括其他客户端连接在内的所有此类更改发布 (INotify)PropertyChanged,但我没有找到与此相关的证据或详细信息。
任何人都可以阐明这一点吗?其他例如 ORM 等是否在实体上提供广播 (INotify)PropertyChanged 事件?
One of our 'frontend' developers keeps requesting from us backend developers that the backend notifies all connected clients (it's a client/server environment) of changes to objects. As in: whenever one user makes a change, all other connected clients must be notified immediately of the change.
At the moment our architecture does not have a notification system of that kind and we don't have a sort of pub/sub model for explicitly chosen objects (e.g. the one the frontend is currently implementing).. which would make sense in such a usecase imho, but obviously requires extra implementation.
However, I thought frontends typically check for locks for concurrently existing user changes on the same object and rather pull for changes / load on demand and in the background rather than the backend pushing all changes to all clients for all objects constantly.. which seems rather excessive to me.
However, it's being argumented that e.g. the MS Entity Framework does in fact publish (INotify)PropertyChanged not only for local changes, but for all such changes including other client connections, but I have found no proof or details regarding this.
Can anyone shed some light into this? Do other e.g. ORMs etc provide broadcasted (INotify)PropertyChanged events on entities?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些通知纯粹是
OnChange += SomeHandler
类型的本地通知。您所请求的似乎是新的响应式扩展库在 .NET 4 中引入的内容。不过,即使使用 Rx,此类通知也不会是自动的;需要对发布/订阅通知进行一定程度的处理。These notifications are purely local notifications of the
OnChange += SomeHandler
variety. What you are requesting seems to be what the new Reactive Extensions library is introducing with .NET 4. Still, even with Rx, such notifications would not be automagic; some amount of handling of the pub/sub notification would be required.