HighTechTalks DotNet Forums  

[Serializable] vs. MarshalByRefObject in COM+ application

Dotnet Framework (Component Services) microsoft.public.dotnet.framework.component_services


Discuss [Serializable] vs. MarshalByRefObject in COM+ application in the Dotnet Framework (Component Services) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default [Serializable] vs. MarshalByRefObject in COM+ application - 11-16-2004 , 07:37 AM






I have a COM+ application implemented as managed code (a C# class
deriving from ServicedComponent). It gives out another C# class as a
return value for one of it's methods.

I've found (and seen it confirmed on these newsgroups) that this will
only work if the class returned from my COM+ application's method is
either
- marked as [Serializable]
- derived from MarshalByRefObject.

However here's what I don't understand: I would assume (and have seen
it alluded to) that the class would be passed by value if it was
marked as [Serializable], and would be passed by reference if it
derived from MarshalByRefObject. I'm seeing it passed by reference in
_both_ cases.

I tested this by marking the class as [Serializable] (and not deriving
it from MarshalByRefObject) and then invoking the method on my COM+
application that returns an instance of the class.
- When the class is huge (a public byte array of 10000 bytes), I
don't see that much DCOM traffic on the network, so clearly the whole
thing is not being serialized from the server to the client
- When I set a breakpoint on one of the class's methods on the COM+
server, it is hit when that method is invoked from the client. If the
object was being serialized and passed by value to the client, I
should not hit the breakpoint on the server.

Does anyone know what this behavior is?

Thanks,
Dave

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.