Well, I thought about it tonight, and I've decided that one intriguing way to solve this problem would be to write a JSON adapter for Xmldoom objects (if there isn't one already). Then I could Xmldoom-ize the data being talked about in user_preferences.pcgi, serialize it as JSON, pass it to the dojo-page to parse, modify that JSON object, and pass it back to be saved. GET on user_preferences.pcgi would render HTML by default, but if you pass it &json, it will just give you the JSON for the objects being talked about. This will not only make for nicer code in this one spot, it's a good model for modifying existing Xmldoom objects.
If we don't want that whole thing, we could do a comprimise - and just do the JSON handling manually. That wouldn't be too bad, and it's certainly a better structure than what we've got. I like this model...
No comments:
Post a Comment