unknown
10/28/2004 3:34:00 PM
Hi Ken,
Thanks so much for your quick response.
This works? Wow! How does remoting know that the MyCAO object is a CAO?
Don't I have to define that somewhere?
If I setup the SAOFactory as SingleCall SAO then will the MyCAO object still
exist once the SAO call has completed?
I find this very unintuitive since there has never been an explicit
definition saying that MyCAO object is a CAO but I guess it makes sense.
Thank's so much!! :)
-ZD
"Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in message
news:%23M5AaFQvEHA.1204@TK2MSFTNGP10.phx.gbl...
> 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
>>
>>
>
>