Solution for dynamic data model (metadata)?

Jul 26, 2010 at 1:29 PM
Edited Jul 26, 2010 at 3:42 PM

Hi,

thanks for sharing this project, I was really happy when I discovered it!

I would need advice regarding some special needs which I will explain shortly.

If I got it right, your OData library assumes a static data model / metadata. Thus one can generate the proxy classes from the data model with the odatagen tool, which is great.
However, it turned out that my project is special: the data model can change over time (can be customized/extended on server side), therefore the approach with proxy classes generated in advance won't work.

My question: is it possible with the current client library to build the proxies at runtime (instead of having pre-generated proxy classes)? Eventually are you planning to add such features?
If there is no solution, could you please advice which would be the best way to extend the current OData library in order to achieve this dynamic behaviour (if possible at all).

Thanks,
Karoly

Jul 26, 2010 at 6:35 PM

Hi Karoly,

In general the scenario where server-side data model change over time (without updating the client side) is not what we considered a mainstream scenario so we didn't add support for it. Potentially you could look at the odatagen code and see how the proxy classes are generated based on the metadata exposed by the service but you will have to write the code to create them dynamically. But considering the complexity involved it could be probably easier to just build the queries dinamically and write the code to deserialize the ATOMPub or JSON responses from the server.

The only other option I can think of is to version the server side data model so you can deploy clients that are able to handle the specific version of the data model exposed by the server.

Hope this helps

Claudio

 

 

 

Jul 27, 2010 at 10:35 AM
Edited Jul 27, 2010 at 10:35 AM

Hi Claudio,

thanks for your prompt reply!
I tried to dynamically generate the proxy classes, but I met a serious blocker: even though in ObjC classes can be generated at runtime, I haven't seen any solution for binding a method *implementation* to the given class, except it's already defined in the source. Eventually do you know a way to achieve this?

The second approach won't work, as we do not know beforehand the specific data model versions, furthermore each customer is free to change it anytime. Our client has to reflect the changes automatically.

Thanks for your help,
Karoly