Re: Object Design Question
- From: Mehdi <vioccc@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 2 Aug 2005 17:53:18 +0100
On Mon, 1 Aug 2005 18:09:26 -0400, Jason Callas wrote:
> After reviewing my design I realized that I cannot just serialize my object.
> This would create a COPY of it and send it to the Manager. Any changes the
> Manager made would never make it down to the client.
>
> How can I get a remote reference to the client? Can I just inherit from
> MarshalByRefObject?
Yes. In your known layer, declare the interface of the client object that
will have to be called by the server. The server having access to your know
layer DLL will then know what methods are available and won't need to have
access to the implementation of this class.
In the client application, implement this interface and make this class
inherit from MarshalByRefObject. Do not make this class serializable. Then
call your subscribtion method on the server passing your MarshalByRefObject
as a parameter. The server can now call methods on this MarshalByRefObject
object that actually remained on the client side (by passing the
MarshalByRefObject, i believe that you have actually sent a Transparent
Proxy object to the server, not a copy of the object itself).
Of course, unless you are using a bidirectional channel, this means that
the client will have to have registered a port to listen for server
callbacks and that this port must be opened in the client's firewall.
.
- References:
- Object Design Question
- From: Jason Callas
- Re: Object Design Question
- From: Jason Callas
- Object Design Question
- Prev by Date: Typed datasets and DateTime using .NET remoting over differing timezones
- Next by Date: Serialization and remoting with dynamic appdomains
- Previous by thread: Re: Object Design Question
- Next by thread: "Requested Service not found" while event call to the absent client
- Index(es):
Relevant Pages
|
Loading