Oliver Vogel wrote:
@Christoph
i am actually working at a php class to send only the qooxdoo classes to the client, the client needs. this ist not any kind of Frameworks. My file only detects, what Qx-Objects a Js-Programm needs, what Qx-Objects they depends on and then compiling then to one minimal file. do you think, you can need this in your Framework? if yes, i am actually working on it and after some kind of bug-fixing i will bring it to the list.
I did something very similar in Java space. It uses reflection to detect every method signature exported by the server over JSON-RPC. All of the return types of those method signatures are added to a list. Next the list is iterated, and every field inside each return type is added to the list if it's not a standard Java type (ie a "primitive" in Java, or a primitive type wrapper). This then is then used create an array of Metadata objects. There are put inside a map. The keys of the map are the return type, and the value is the Metadata object array. The Metadata object simply stores the fieldName, getterName, setterName and javaType. Over on the client side, I've written something that queries the service which builds the map<String,Metadata[]> and parses through it. Each class on the Qooxdoo side is then generated, with Qooxdoo's addProperty support used. In addition, Qooxdoo's property constraint services are used to ensure some degree of type safety in Javascript, and it works quite nicely. I am going to be extending it shortly to use Java annotations, so these can be sent back to Qooxdoo - so it has even more flexibility when building the client-side objects (such as for more advanced validation etc).

Cheers
Ben

PS: For the Java readers out there, I'm not storing a Map<String,Metadata[]> but instead a Map<String,List<Metadata>>. The String is the fully qualified classname of the return type. I didn't want to further confuse the above explanation by introducing two lists (there's also a third list, used to detect recursive loops when iterating the nested fields).


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to