开发者

How to handle unexpected disconnect

I've got a question concerning best practices with .NET remoting. The code is smelly and I need to do some refactoring.

The thing is: I've got multiple classes that derive from MarshalByRefObject and their data is used in the client software. Once the server disconnects I get RemotingException.

The bad thing about this is: My references to all the MarshalByRefOb开发者_如何学运维jects are all over the place (including but not limited to the GUI) and upon disconnection the exception turns up anywhere in my code.

Obviously I'd like to handle those exceptions in one place. Are there any best practices for this?

Essentially, I'd like to put together some sort of "offline"-mode for the client


Managed to solve this problem with the use of Proxy Design Pattern

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜