tags:

views:

175

answers:

0

I'm using .NET Remoting to communicate between client and server applications. The MarshalByRefObject on the server side activates as singleton. The question is: how can I get from this object some other objects that have been created in server application runtime? Here is a simple example: what if the remote object needs to show something in server's application form? (I'm not searching for highly tailored solutions exactly for this case)

The first solution I see is using some static container to store references for necessary objects. So the remotely-activated object can get them when it needs to. But I think this way is not good enough. It resembles to global variable usage and drew all related shortcomings. The most preferable design could be bunch of events in remote object with handlers which performs suitable operations with external objects. But the problem is how to get reference to remotely activated object (if this is possible/suitable)?

Probably there are already exists some common solution for this problem and I'm reinventing a wheel now. But I yet haven't found an appropriate example in all tutorials I've already seen. So, can anyone give me a hint?

(I'm using C# and .NET 3.5)