Re: Remoting & CAO Question
From: Ken Kolda (ken.kolda_at_elliemae-nospamplease.com)
Date: 10/28/04
- Next message: Dave: "How do "dirty checking" with a Windows Form?"
- Previous message: Stefan Simek: "Re: Parsing and storing formulas"
- In reply to: Z D: "Remoting & CAO Question"
- Next in thread: Z D: "Re: Remoting & CAO Question"
- Reply: Z D: "Re: Remoting & CAO Question"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 28 Oct 2004 08:17:16 -0700
To do this with CAOs you create an SAO object factory that instantiates and
returns your CAOs. For example, say you have an object which will be
client-activated and for which you've defined an interface that will be in
your shared assembly:
public class MyCAO : MarshalByRefObject, IMyCAO
{
// ...
}
Then create an SAO factory as follows:
public class CAOFactory : MarshalByRefObject, ICAOFactory
{
// Function to create your CAO object
public IMyCAO CreateCAO()
{
return new MyCAO();
}
}
In your client, you use Activator.GetObject() to get the SAO class factory,
then invoke the CreateCAO() method to get your CAO object reference. For
example,
ICAOFactory factory = (ICAOFactory) Activator.GetObject(typeof(ICAOFactory),
"tcp://...");
IMyCAO cao = factory.CreateCAO();
Using this technique you don't need the CAO's class definition on the
client, just the interface definitions.
Ken
"Z D" <nospam@nospam.com> wrote in message
news:Of2Go%23PvEHA.3728@TK2MSFTNGP12.phx.gbl...
> Hello,
>
> Is it true that I need to push the DLL for my entire class if I wish to
use
> CAO remoting???
>
> Can't I just use an Interface to the class on the client side and
> instantiate the object in a similar fashion to using SAO Singleton with an
> interface? ie:
>
> Dim MyPerson As IPerson
> MyPerson = Activator.GetObject(GetType(IPerson), <RemotingURL>)
>
>
> How can I do this using CAO in a similar fashion?
>
> Thank's in advance,
> -ZD
>
>
- Next message: Dave: "How do "dirty checking" with a Windows Form?"
- Previous message: Stefan Simek: "Re: Parsing and storing formulas"
- In reply to: Z D: "Remoting & CAO Question"
- Next in thread: Z D: "Re: Remoting & CAO Question"
- Reply: Z D: "Re: Remoting & CAO Question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|