I have been meaning to review this API, I finally got a chance to do so and I have some suggestions for changes to it. Of course I don't want to take away from the spirit of the idea too much but I have a few suggestions which reflect things which I often find myself wanting to do in my applications.
I've updated the page adding things which came to mind as I reviewed the proposal. One major thing I would like to see is transactions, I know it makes the api more cumbersome but it does not need to make it much more cumbersome, it gives the programmer much more power if they want it and and it can potentially improve performance in the javascript version as it can flush all of it's changes back at once, rather than making many http requests. A second comment is on the semantics of the store and get requests, I would like to see common semantics between the get/set of object fields in velocity/groovy and in Javascript, using a JSON Map to specify groups of fields to set is suboptimal because I would like them to be checked as they are set. Clearly velocity and groovy XObjects can have general purpose get()/set() methods which throw errors if invalid values are passed and after some research, I determined that in Javascript, the Object.preventExtensions() and Object.defineProperty() can be used to prevent the user setting any non-existant variables but can also type-check the variables as they are set. Overall I'm fairly excited with this proposal and it will be interesting to see how it turns out. Thanks, Caleb On 02/27/2015 10:48 AM, Fabio Mancinelli wrote: > Hi all, > > some time ago we wrote about an idea of having an extensible API for > accessing structured data. > > The final goal is to have a uniform API for accessing structured data > both on the client (Javascript+REST) and on the server. > > We have written a little design document that I am submitting to the > list for comments: > http://design.xwiki.org/xwiki/bin/view/Proposal/ExtensibleAPIforaccessingstructuredata > > This idea is also related to other ones, like providing a way for > dynamically extending the REST API, and also to the integration with > client side frameworks like AngularJS. > > Thanks, > Fabio > _______________________________________________ > devs mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/devs > -- Satire is the escape hatch from the cycle of sorrow, hatred and violence. #JeSuisCharlie _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

