NHibernate lazy-loading over a web service

ⅰ亾dé卋堺 提交于 2019-12-12 00:44:06

问题


I have a web application that will get domain objects from a web service, which in turn gets them from a database via NHibernate.

I'd like to be able to transfer these objects with uninstantiated members (members that are typically lazy-loaded from the database in the web service) and then have subsequent calls automatically made to the web service when the application code tries to access them. Essentially a process identical to regular NH lazy loading, except with the web service in place of the database server.

Note that this happens within a LAN and with low transaction rates, so I'm not concerned with whatever performance penalty this is likely to have.

I would think that what's needed is first code that gets invoked when serializing to the objects that turns the NH lazy-loading proxy information into something that can be reconstructed on the client side, and then client-side code to deserialize that information into objects of a different proxy type, one that will make a web-service call to retrieve the lazy data when it is referenced.

I would think someone would have developed such a framework already, but I haven't managed to find it, so I figured a direct question was in order.

If you know of any work that's been done in this area, please respond.

Michael

来源:https://stackoverflow.com/questions/18038301/nhibernate-lazy-loading-over-a-web-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!