By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,481 Members | 1,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,481 IT Pros & Developers. It's quick & easy.

Java Applet vs. AJAX for continuous data

P: n/a
I just saw a Java applet that establishes a continuous
connection with the server to display data like a chart
recorder -- very cool. I did some searching to see how
this differed from an AJAX technique along with the pros
and cons, but so far I have yet to get much insight.
I'm interested in performance (fastest that each can
reliably update the browser), reliability, security, and
customization (looks like a Java applet can be made to
look like a chart recorder with controls), etc. So, I
hope someone that has done both can comment on the
differences, pros, and cons of each. I'm using JavaScript
and doing an AJAX application that does a similar thing,
but I have not ventured into Java and applets yet (on the
To Do list when I have time). Thanks for the help.

Yes, I know this is a JS NG, not a Java NG, but I can hope,
right? Besides, this web interface doesn't seem to allow
cross posting, so...

Dave Boland
---
d boland 9 (all 1 word) at Fastmail period fm

Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Depends what you mean by 'continuous connection'.

I wrote a Java Server along with an Applet which allows continuous
connections using Sockets. I also wrote the Server to allow multiple
connections which is what you will have to do when you write yours
else only one applet can connect at any one time.

If your using Ajax then you can give the impression your continuously
connected by querying the server in short intervals, but your never
continuous connection, your just calling a php/asp/what ever file on
the server and getting hte response.

In my case I chose Java sockets because I built a chat room. I didn't
use a database which meant the server updated all the users connected
automatically using the open sockets which require a Constant open
connection. e.g. someone said something in the room, the message was
sent to the server, the server updated all open connections with the
new words.

Unless you need major two way communication I would use Ajax. You
could Use JSON as your data transfer method or just plain old XML

Have fun!
Graham
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.