模型 - 视图 - 发布者作为设计模式?

发布于 2024-12-15 01:11:37 字数 365 浏览 4 评论 0原文

我想我应该在这里问这个问题。有谁知道涉及基于推送的数据传输的“MVP”设计模式正在做的任何工作(不要与模型-视图-呈现器混淆)?

我将其称为模型-视图-发布者,或者模型-订阅者-发布者,其中订阅者类似于视图,发布者类似于控制器。

这里的想法是,您有一个“发布者”,而不是响应客户端请求的典型控制器,它在发生某些事件时将数据推送到客户端“订阅者”。推送将通过长轮询/反向 ajax/comet 或其他类似方法进行。

是否存在这样的框架?如果不存在,它会是一个有用的模式吗?我对客户端上的 C# / Javascript 或后端的 NodeJS 实现特别感兴趣。

或者,是否有任何 MVC 框架或实现提供使用 Comet 等技术将数据推送到客户端的控制器?

I thought I would ask about this here. Does anyone know of any work being done with regards to a 'MVP' design pattern involving push-based data transfer (not to be confused with Model-View-Presenter)?

I'd call it Model-View-Publisher, or perhaps Model-Subscriber-Publisher where a Subscriber is analogous to a View and a Publisher is analogous to a controller.

The idea is here is that instead of your typical controller that responds to client requests, you have a 'Publisher' which pushes data to client 'Subscribers' when some event occurs. The push would be via long polling / reverse ajax / comet or some other similar method.

Do any frameworks such as this exist, and if not, would it be a useful pattern? I'd be specifically interested in implementations in C# / Javascript on the client or maybe NodeJS on the back-end.

Alternatively, are there any MVC frameworks or implementations that provide controllers which push data to the client using technologies such as Comet?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

妖妓 2024-12-22 01:11:37

我想对网络套接字的支持很快就会到来。有关当前 Web 套接字支持,请参阅 带有 ASP.NET MVC / MVVM 的 Websockets

I imagine support for web sockets will be coming soon. See Websockets with ASP.NET MVC / MVVM for current web socket support

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文