Re: Remoting & CAO Question

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Ken Kolda (ken.kolda_at_elliemae-nospamplease.com)
Date: 10/28/04


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
>
>



Relevant Pages

  • Re: Can you determine CAO from SAO with TransparentProxy?
    ... SAO and CAO are NOT types of objects. ... I.e. the client decides when this object to be created. ... Standard factory pattern. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Remoting & CAO Question
    ... Then create an SAO factory as follows: ... then invoke the CreateCAO() method to get your CAO object reference. ... client, just the interface definitions. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Remoting & CAO Question
    ... Then create an SAO factory as follows: ... then invoke the CreateCAO() method to get your CAO object reference. ... client, just the interface definitions. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Can you determine CAO from SAO with TransparentProxy?
    ... > SAO and CAO are NOT types of objects. ... > I.e. the client decides when this object to be created. ... > Standard factory pattern. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Can I CAO interfaces?
    ... What type is yoyr remoting object SAO or CAO? ... > I have defined an interface that is implemented by my server object, ... but the client only that the interface definition. ...
    (microsoft.public.dotnet.framework.remoting)