开发者

Encapsulating WCF RIA services?

We would like to encapsulate WCF RIA services on client side within technology independent data services (aka Repositories, following Martin Fowler). Thus entities and colle开发者_StackOverflowctions exposed by viewmodels should not depend on RIA technology / namespace.

Now we are faced with the problem that RIA generated client entities are based on RIA-Entity-Class and especially collections based on RIA-EntityCollection-Class.

Is there a way to achieve following dependency:

ViewModel -> IDataService -> RIADataServiceImpl -> Server


You can apply interfaces to the WCF RIA classes. They are all partial classes so you can declare the interface in a static file (as opposed to hacking it onto a generated file).

I used this to try and separate some of my logic from the WCF RIA entities but in the end I found that there was a lot of repeated boiler plate code and my project was still quite dependent on the framework anyway.

Your mileage may vary but it will let you access the entities with out knowing about the WCF RIA name space.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜