Hey,
we do have a JSON marshaler [1] which would take care of such transormations. 
This marshaler does use implicitly created classes for each object. So in the 
given sample, it would create a class offering the properties id, name and 
father. Based on that class, it would create an instance of person #25. As soon 
as the marshaler sees the object stored as father, it checks for the properties 
and will use the same class as these are the same properties.
In short, this will work out of the box.
Regards,
Martin

[1] http://demo.qooxdoo.org/current/apiviewer/#qx.data.marshal.Json~createModel

Am 16.10.2012 um 18:50 schrieb Jeffrey Willden 
<[email protected]<mailto:[email protected]>>:

Hello,

I worked on developing a framework similar to qooxdoo but due to licensing, I 
am unable to use it on other projects. So I am looking at qooxdoo. Great job! 
It's an impressive framework.

One of the features I'm not seeing yet is the ability to define an instance 
member or property that is an instance of a class (not just a primitive value). 
For example, if I pass the following json to the marshaler:

// person
{
id:25,
name:'Jane Doe',
father: {
id:26,
name:'John Smith',
father:null
}
}

Then it would instantiate one Person with an id of 25, and another Person with 
id 26, and make the 'father' member of the first equal to the second instance. 
The marshaler would know from the declaration that 'father' is an instance of 
Person so it would instantiate it (recursively in this case).

How are these sorts of compound objects created in qooxdoo? So far I'm seeing 
only primitive member types (Number, String, etc).

Jeff
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to