2

Overview I am doing the introductory decision making on technology for a new project. We will need to have business objects maintained in a central location and viewed on client devices. The client devices will be thick clients (WPF, Silverlight, MacOS, Linux) and mobile clients (Android, iPads/iPhones, WP7). The nominal use case is a LAN scenario, but distributed internet use is also a possibility. We need to be able to have the central location (thinking WCF service) update the business objects based on input from the clients and rapidly have the view of those business objects be updated on all connected devices that are viewing those objects.

Security Security is a low concern, the only important data to be transferred is names at this point, although final decision there has not been made.

Basic Question My basic question is this: How to best approach this? I am thinking a WCF service as the home for the business objects, but we need distribution of changes to be very rapid. Preferably it would seem instantaneous to users. To me, that means around 1/4 second. I just don't know if that is possible. I'm assuming to reach the device audience, it would need to be a basic web service. What will polling at that rate from the devices do to battery life of devices? Is there an elegant way to push to all those devices?

PatrickV
  • 2,057
  • 23
  • 30

3 Answers3

1

Since you need a very short update/propagation times (1/4 sec) you'd need to use a very fast web service polling, which is IMO not achieveble.

For such short delays your best bet would be to use some kind of web push technology (comet, websockets) or even directly sockets.

Also, I don't think you can push to devices that are in sleep mode. They would at least need to have processor and network running, which would of course significantly shorten the battery life.

Peter Knego
  • 79,991
  • 11
  • 123
  • 154
  • That's my concern too Peter. My first thought was direct sockets, but I figured that would be difficult to handle given the device landscape we want to support. But if it were easy, I guess everyone would do it. Unless a better suggestion is brought to the table, we'll probably relax the polling frequency to the point that users complain and just do a "polling while the user cares" approach with a REST-based WCF service. Thanks for the input. – PatrickV Aug 25 '11 at 02:11
1

You can use JSON for WP7 as well, its usually a little faster to work with on WP7 and efficient especially when compressed, also in WP7 Mango you could implement a Background Agent which updates periodically (10~30mins) dependant on usage of the phone while the app is dead.

in your scenario Push Services would be Ideal for all the devices but polling constantly runs the battery down and also hits hard on the users bandwidth. However your not guaranteed that it will land on the device (atleast on WP7 your not from my experience as devices have a limit of services to bind with). Mango Supports Sockets which is probably ideal as your using very little bandwidth and as long as the user doesnt loose connection almost guaranteed delivery of your content or a flag for the device to start polling.

Only concern is 1/4s is quite harsh for Mobile devices if they are on Mobile Services instead of a WiFi connection. There are reportedly issues with UDP performance for WP7 see Poor UDP performance with Windows Phone 7.1 (Mango)

I have never done anything like this but I am about to look at implementing sockets myself for Mango, currently just using Push Services through my WCF Service which is delivering all the content.

Good Luck

Community
  • 1
  • 1
  • Thanks for the input John. What does the push landscape look like for all devices? I assume if we use that, it would be a device-specific approach with a different service point for each type of push notification service. The 1/4 second is for the LAN experience - we'd have to relax that for distributed use (still not even sure if we're going to support that mode of operation, the typical use case for this is a group of people sitting around a table). – PatrickV Aug 26 '11 at 18:43
0

In our team we had the same requisite to develop an app that is multi platform such as iOS WP7 Silverlight and so on.

For us the best practice was to develop a service in .NET using WCF RIA service in addition to some endpoint like SOAP for WP7 and JSON for iOS.

The data responsiveness is very fast.

fncap
  • 126
  • 5
  • Yes http can be quite fast, but he needs data push which means that with web services all devices would have to poll constantly. – Peter Knego Aug 24 '11 at 23:45
  • As Peter said, my main concern is how do I let the clients know to update the business objects without taxing the battery and/or bandwidth too much. – PatrickV Aug 25 '11 at 02:14
  • in .Net (so WP7 & Silverlight) you can use WCF Classic to "push" a signal to device that force itself to reload data! For iOS only way is to use Push Notification System – fncap Aug 25 '11 at 09:10