473,322 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

ContextBoundObject And Serialization

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

Jun 14 '06 #1
2 2585
"sternr" <St****@gmail.com> wrote in message
news:11*********************@h76g2000cwa.googlegro ups.com...
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

Jun 14 '06 #2
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

Jun 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: Ben | last post by:
Hi, there. Recently I was working on a problem where we want to save generic closures in a data structure (a vector). The closure should work for any data type and any method with pre-defined...
3
by: Aaron Clamage | last post by:
Hi, I'm not sure that if this is the right forum, but any help would be greatly appreciated. I am porting some java serialization code to c# and I can't figure out the correct way to do it. ...
3
by: Alexander | last post by:
When i store rule on PC with .NET.SP1 i cant restore them from PC without SP1. An i get this Error: System.Runtime.Serialization.SerializationException: Possible Version mismatch. Type...
1
by: pinetaj | last post by:
Hello, I'd like to intercept some method invocations on certain object. For the object, I wrote a class inherited from ContextBoundObject. and also related classes to implement attribute,...
4
by: mijalko | last post by:
Hi, I have inherited my class from System.Drawing.Printing.PrintDocument and I wish to serialize this object using XmlSerializer. And I get exception "There was an error reflecting type ...". If I...
5
by: Nikola Skoric | last post by:
I ran in Mono a program developed on .NET Framework 2.0 and it ran OK until I tried to desirialize a object. There the program died abruptly dumping this: System.ArgumentOutOfRangeException:...
0
by: bharathreddy | last post by:
Before going to that i want to say few thing on serialization : Serialization is the process of converting an object into a form that can be readily transported. For example, you can serialize an...
1
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
2
by: mkvenkit.vc | last post by:
Hello, I hope this is the right place to post a question on Boost. If not, please let me know where I can post this message and I will do so. I am having a strange problem with std::string as...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.