Search code examples
c#model-view-controlleroopnode.jscomet

Model - View - Publisher as a design pattern?


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?


Solution

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