Code review comment for lp:~leonardr/lazr.restful/double-your-enjoyment-2

Revision history for this message
Leonard Richardson (leonardr) wrote :

This branch adds the first bit of multi-versioned web service code, by making it possible to register different objects as the IServiceRootResource implementation for different versions. I illustrate in multiversion.txt by registering different root objects for the 'beta', '1.0', and 'dev' versions of that web service.

If you don't have multiple web service versions, you can still register your root resource object as the IServiceRootResource utility (without providing a name), and it will always be picked up. You don't have to register the same object separately for every version.

Previously, the 'publication' object was always the IServiceRootResource utility. But now there can be more than one IServiceRootResource utility. So we start off by setting the publication to None, and after doing a little hard-coded traversal to determine which version the client requested, we set the publication to the _appropriate_ IServiceRootResource utility and traverse from there.

I refactored the create_web_service_request() function from webservice.txt so that I could also use it in multiversion.txt.

« Back to merge proposal