Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi guys,

 

I have little experience with remoting and now am trying to build an app. using .net remtoing. And now I am stuck on using whether marshal-by-value or marshal-by-reference

 

I have read Rockford's "Expert One-on-One Visual Basic .NET Business Objects" and in his framework he used marshal-by-value object.

 

From his book...

Now, some objects will contain variables that are references to other objects. When we serialize such an object, not only is that object serialized, but the resulting byte stream will also include the variable data from any objects that it references. When objects reference other objects, the result is called an object graph, and when one of these byte streams is deserialized, the entire object graph is recreated. The original objects and its references are effectively cloned.

OK, that means I will potentially pull A LOT objects across the network when I try to get a, say a customer, object. My question is is this possible to lazy load some references instead of load EVERYTHING at once when serializing the customer object? Do I need to code a lot to handle this?

 

Any resources will be great. Thanks. :)

 

Michael

There is no spoon. <<The Matrix>>
Posted

Off hand, I use marshalbyref primarily for class factories.

 

Care must be taken in creating 'chatty' objects. If a commonly interfaced object is marshalbyref, remoting calls to get property values can severely cripple the applicaton. Also, you may find that, in some cases, it might be beneficial to pull an aggregated marshalbyref field/property at the same time you pull the primary marshallbyref object, but in other cases, the same entity might be better implemented by having the property 'getter' make a call to instance a new object. This means you might have two identically applicable classes, one contains an actual instance of some other class, and the other pulls the aggregated instance dynamically. Depending on anticipated use, you instance one else instance the other.

 

As far as references, pollard's code generation in .net has a chapter dedicated to object graph strategies.

 

 

 

PS Damn the California Angels!

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...