PC Review


Reply
Thread Tools Rate Thread

ContextBoundObject And Serialization

 
 
sternr
Guest
Posts: n/a
 
      14th Jun 2006
Hey,
I have ContextBoundObject dervied class, that holds a hashtable.
The hashtable contains objects from my DomainModel (Person,Employee
etc.).
All of this objects (my domain model and the ContextBoundObject) are
NOT marked as Serializable!

I send this ContextBoundObject to a ServicedComponent derived class
(ServerActivated) as a parameter and everything works perfectly well.

My question is, since the object has been shared between 2 processes, a
serialization process must'v taken place, even though I didnt mark my
objects as Serializable -- HOW???
Can someone please shed some light on there case for me,

Thanks ahead

--Rami

 
Reply With Quote
 
 
 
 
Ben Voigt
Guest
Posts: n/a
 
      15th Jun 2006
"sternr" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hey,
> I have ContextBoundObject dervied class, that holds a hashtable.
> The hashtable contains objects from my DomainModel (Person,Employee
> etc.).
> All of this objects (my domain model and the ContextBoundObject) are
> NOT marked as Serializable!
>
> I send this ContextBoundObject to a ServicedComponent derived class
> (ServerActivated) as a parameter and everything works perfectly well.
>
> My question is, since the object has been shared between 2 processes, a
> serialization process must'v taken place, even though I didnt mark my
> objects as Serializable -- HOW???
> Can someone please shed some light on there case for me,


I think that objects marked as Serializable, participate and control
serialization. Everything else gets default handling from the core
serialization code using reflection.

>
> Thanks ahead
>
> --Rami
>



 
Reply With Quote
 
sternr
Guest
Posts: n/a
 
      19th Jun 2006
It took me quite sometime, but I found the answer!
ContextBoundObject inherits from MarshalByRefObject.
This object - when passed between 2 AppDomains (or processes for that
matter),
Will create a dynamic proxy for the object, which means that all the
data "inside" this obejct is never serialized\deserialized since it
never really leaves its appDomain!
The good thing is you get better performance and better scalability for
the objects hold inside the MarshalByRef-ed object - since they dont
need to worry about serialization,
And are called only on demand (kinda like lazy-load)
The bad thing is that every call to a property or a method to this
object will result in a remoting "conversation" EVEN IF IT'S IN THE
SAME PROCESS!, and it's also makes the consumer more connected to the
marshaled object!

Hope this will shed some light for some of you - it did for me

--sternr

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
<Remoting.Contexts.Synchronization()> and inheriting ContextBoundObject RJ Microsoft Dot NET Framework 0 15th Jun 2007 09:13 PM
access an actual object of ContextboundObject in sink class? pinetaj Microsoft C# .NET 1 18th Jun 2006 02:19 PM
Using ManualResetEvent within a ContextBoundObject =?Utf-8?B?QW1pciBTaGl0cml0?= Microsoft Dot NET Framework 1 26th Mar 2006 11:57 PM
Re: Issue with tracing a method call on a ContextBoundObject when it is called thru an interface Alexander Shirshov Microsoft C# .NET 0 12th Mar 2005 06:15 AM
Why isnt ContextBoundObject an interface? Brian Takita Microsoft Dot NET Framework 1 9th Jan 2004 11:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:29 PM.