Bob Hanson wrote:

Currently I've got getProperty() working from within Viewer, and only intended for use by the applet; I'd like to know more about how a "common" interface might be set up. Presumably this means that the applet and app would have the same interface but implement these differently -- one using JSON objects; the other some sort of agreed-upon Java data structures. I don't in any way want to imply that I know how to do this.

I like Miguel's idea that a common class could generate Java structures that could then be simply converted into JSON objects on the fly instead of creating two distinct parallel methods.


Let's try to work on how to make it useable for both Java and JavaScript.

First, I think we should concentrate on defining the kind of data structure the getProperty() mechanism should be able to return.

I am putting a first draft in this mail.

My understanding is:
- The getProperty() method could return an "Object" or an ordered array of "Object".
- An "Object" itself is simply an unordered collection of "Property".
- A "Property" is the combination of a "Property Name" and a "Property Value".
- A "Property Name" is a string.
- A "Property Value" can be of several kinds: string, integer, floating point, boolean, (are there others ?), "Object" or even an ordered array of one of the previous types.
and that's all.

After writing it, it seems quite simple.
Am I wrong ? What have I overlooked ?
Don't hesitate to add comment, say I am wrong, ...

If I am not too far off, that should be easy to implement the getProperty() method to return a Java object, and the getJsonProperty() method to convert this Java object into a JSON string.

What do you think ?

Nico




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to