D
Dave Boland
I'm planning a software upgrade to an embedded device that uses a PC
web browser as the GUI for configuration and data report. The new
requirements need faster refreshing so it seems real time, and only
key data is being updated. Sounds like a possible application for
AJAX, but I have a few questions before I go down that road. My hope
is that some of you have also done something like this.
First some more information about the application. The embedded
processor has a RTOS, web server, limited RAM and flash, 500 KB/s
network port. The server scripts are written in C. The data being
refreshed dynamically (without tags) is about 60 bytes per line, 32
lines, for a total of just under 2KB every second. Tags may increase
the data load to 5 KB every second. The data is tabular, but my
suspicion is that sooner or later there will be a graphical display.
Questions:
1. Is JavaScript/AJAX the best way to do this, or would a Java app.
offer better performance? I have yet to find a good comparison
between the two doing essentially the same task.
2. How do I write code that can manage multiple requests for
different data that will return out of order? All of the AJAX code
examples I have seen so far seem to assume the request is filled (or
error) before another request is sent. In this situation I may want
to break up the application into a number of smaller requests to
reduce the data per request.
3. AJAX libraries. I was looking at two libraries this morning
(prototype and ZK), but it is not clear to me what the benefit would
be for a simple application like this one. Are there other libraries
that I should look at?
4. Is JASON the better way to move data from the server to the
application? From what I have learned it seems that there would be
less data across the network (compared to XML) and the JavaScript
overhead to write the data looks to be better. Still, the tags
increase the data transported by at least 2X, so I'm also considering
a custom format like we do if the data was going across a really slow
serial connection (9600 bps).
5. Any other topic I should address that I currently have no
awareness (at this time)?
Thanks for the help.
Dave,
web browser as the GUI for configuration and data report. The new
requirements need faster refreshing so it seems real time, and only
key data is being updated. Sounds like a possible application for
AJAX, but I have a few questions before I go down that road. My hope
is that some of you have also done something like this.
First some more information about the application. The embedded
processor has a RTOS, web server, limited RAM and flash, 500 KB/s
network port. The server scripts are written in C. The data being
refreshed dynamically (without tags) is about 60 bytes per line, 32
lines, for a total of just under 2KB every second. Tags may increase
the data load to 5 KB every second. The data is tabular, but my
suspicion is that sooner or later there will be a graphical display.
Questions:
1. Is JavaScript/AJAX the best way to do this, or would a Java app.
offer better performance? I have yet to find a good comparison
between the two doing essentially the same task.
2. How do I write code that can manage multiple requests for
different data that will return out of order? All of the AJAX code
examples I have seen so far seem to assume the request is filled (or
error) before another request is sent. In this situation I may want
to break up the application into a number of smaller requests to
reduce the data per request.
3. AJAX libraries. I was looking at two libraries this morning
(prototype and ZK), but it is not clear to me what the benefit would
be for a simple application like this one. Are there other libraries
that I should look at?
4. Is JASON the better way to move data from the server to the
application? From what I have learned it seems that there would be
less data across the network (compared to XML) and the JavaScript
overhead to write the data looks to be better. Still, the tags
increase the data transported by at least 2X, so I'm also considering
a custom format like we do if the data was going across a really slow
serial connection (9600 bps).
5. Any other topic I should address that I currently have no
awareness (at this time)?
Thanks for the help.
Dave,