0

So i a, writing a 3-tier GIS (geo info sys) system. But the viewer app is a full c# binary and not a web page

So i need to pull lots of objects/data from the midtier to the application I am wondering how todo this

Viewer: c# binary
Backend: An SQL DB + file system for docs
Midtier: c#/nhibernate ORM/messagingserver/jobscheduler

So normally a midtier will generate a webpage for the viewer/browser
The middletier itself has colections of objects which it needs to send to c# remote binary.. how do i do this

And more importantly, how do i push updates/notifactions from the DB to the midtier and then to the c# app ???

Thanks for any hints

Y A
  • 1

1 Answers1

0

So normally a midtier will generate a webpage for the viewer/browser

I'd disagree slightly with this. I'd say the midtier would generate the data that can then be consumed by the view. The view could be an ASP.NET WebForm, an ASP.NET MVC razor view or it could be a WinForm in a C# desktop application.

If you want true separation of data and view then you should probably consider making the backend of your system a web service that can be consumed by either a website/web application or a desktop client/binary e.g.

SQL DB + File System -> Business Logic/Mid-tier -> View (Web/Desktop/Mobile)

Your first view implementation would be the Desktop C# binary view.

And more importantly, how do i push updates/notifactions from the DB to the midtier and then to the c# app ???

Based on this I'm assuming that you want the C# application to instantly receive the updates and that although your app isn't a web app (HTML/JS etc.) it is in fact a web client.

Notifications like this tend to be achieved in a few ways.

  • HTTP Polling
  • HTTP Long-Polling
  • HTTP Streaming
  • WebSockets

The latter is now the standard for real-time bi-directional full duplex communication between a client and a server. However, if the frequency of updates is very low then you could simply implement a web service which your C# client could poll at long intervals to check for updates.

If the update frequency is reasonable, and your requirement for Push notifications suggests it is, then I'd suggest a realtime push system and therefore I'd suggest using a WebSocket server and client. There are a number of WebSocket server and client examples available such as:

If you'd rather remove the need to implement and host your own realtime messaging infrastructure then you could consider a hosted realtime service.

leggetter
  • 15,248
  • 1
  • 55
  • 61
  • Ignore the above comment, i got an editing timeout... Assume i have full duplex unlimited communication Assume small changes occur about one a minute nHibernate gives me a Customer class in the middle tier (mapped to the db of course) Is there a realtime-push framework to transparently mirror this object to the c# viewer? – Y A Aug 16 '11 at 13:42
  • Sounds like you want something like [backbone.js](http://documentcloud.github.com/backbone/) or [knockout.js](http://knockoutjs.com/) but for C#. You would probably need a layer within your C# application which which itself sits on top of the transport mechanism (WebSocket/Comet framework) and manages the create, read, update and delete events. The [implementing MVC with WinForms](http://stackoverflow.com/questions/654722/implementing-mvc-with-windows-forms) question might be a good staring point? (p.s. you can delete old comments) – leggetter Aug 16 '11 at 22:16