开发者

WCF RIA Services - switching to Local Store

开发者 https://www.devze.com 2023-02-11 03:56 出处:网络
I have a Silverlight application that uses WCF RIA Services. I\'d like to be able to switch the datasource to a local store (for example, SQLite) for demo or UI testing purposes.

I have a Silverlight application that uses WCF RIA Services. I'd like to be able to switch the datasource to a local store (for example, SQLite) for demo or UI testing purposes.

At which l开发者_StackOverflow社区ayer should I refactor my code to allow to do this? Is there a way to do this without repeating functionality already present in WCF RIA Services classes (DomainClient, Entity, etc.), or should I create the switch much higher in the abstraction and bypass all of these classes altogether?

Thanks.


The DomainClient is the hook the framework provided for implementing this kind of switch. However, I don't think I've heard of anybody taking that approach. Instead, the split is often made at the Service layer of applications designed using the MVVM pattern (discussed in this video http://channel9.msdn.com/Series/Silverlight-Firestarter/Silverlight-Firestarter-2010-Session-4-MVVM-Why-and-How-Tips-and-Patterns-using-MVVM-and-Service-Pat).

Also, you might find this thread interesting as it discusses some existing patterns that have been used to persist data to the Silverlight isolated store.

http://forums.silverlight.net/forums/p/219768/524983.aspx#524983

0

精彩评论

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