I would like to know about any open source api that can allow my to push data to my UI from the server whenever changes are made to the database. I think one way to do that is using ajax and if i am not wrong the IE uses activeX control to make the ajax work. Our client dont want to have any extra activeX plug-in to make the ajax work. So i am just wondering that is there any other way to achieve the same thing.
It doesn't matter how you wrap things, web applications are request-driven; HTTP was never intended to support push from server to client.
I think one way to do that is using ajax and if i am not wrong the IE uses activeX control to make the ajax work.
You are wrong . Its the XMLHTTPRequest object that the browser uses. That aside, AJAX is still a request driven solution, because it is HTTP based.
Browser based technologies are not really suited to this, with the exception of stuff like Applets, ActiveX, and Flash. However, if you use this sort of thing in a browser you have to consider ignoring the browser altogether and just writing a fat client.
You can do a couple things with AJAX. One is to periodically poll the server for new stuff. That's not really push, it's not immediate and it can add a lot of traffic to your network and server. Another is to make an AJAX request that doesn't respond right away ... the server just sits there until it has something to send you and then it responds. This is pretty near push, but it eats up server resources. In my world - lots of users, lots of traffic - I wouldn't do either of those.
What I have done is an applet that opens a ServerSocket and registers its address with the server at logon. When the server wants to push data it looks up the address and does connect, send, disconnect like any other socket client. True push, very little overhead, connecting is a bit slow if the server wants to send to 10,000 users, the applet requires a JRE and a security file. Not practical on a public site, but works in a corporate world with total control over the workstations.
Any of that illuminating?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad: