views:

250

answers:

5

In the .NET world, does marshalling mean just the preparation of an object/data for transfer across some boundary or over a wire OR does it mean the preparation and transfer across a boundary or over a wire.

And what does to marshal a call mean. Does it mean just the packaging of the call for "transfer" over a context boundary or is it the packaging and sending (i.e. invocation) of the call?

Sorry for being a stickler...

Clarry

+1  A: 

As I have understood it it is the preparation of the data, not the transfer. Still it's not uncommon to use the term to include the transfer as well (I am also guilty of doing this).

Fredrik Mörk
+2  A: 

In my mind marshaling refers to the act of taking an object or data, preparing it for use in a non-native context, and then presenting it to that foreign context.

I think of it in terms of the data or object being "ushered" in an environment in which it is not familiar. This may involve different encoding, a wrapper, etc., and how an object gets transferred is an important part of the marshaling process.

Until the data or object has actually been presented to its new context, I do not consider it marshaled. At that point it has just been converted, encrypted, wrapped or whatever.

As an example, JSON is often used to transfer an object or data from one process to another. When you convert to JSON, I just consider that a transformation from one data structure to another. Once it is being transferred over the wire, THEN it is being marshaled.

So, no context change, no marshaling.

That's my two cents.

RedFilter
+1  A: 

I think it can represent both scenarios.

  • Data Only: Consider PInvoke scenarios. Marshaling is generally used to describe the act of converting data from the .Net format into the corresponding C format.
  • Data and Call: Consider COM calls which cross apartments. In this case both the data needed for the call and the call are considered to be Marshaled as the actual call must cross COM apartments boundaries. I realize you asked this in the context of .Net but I believe this is a solid example that is relatable to .Net. Consider for example using ISynchronizedInvoke to go between threads.
JaredPar
+1  A: 

"Marshal" has several meanings, but apart from it being a title, it means . . .

marshal - mobilize: make ready for action or use; "marshal resources"

So it should just mean "to package", not "to package and to send".

Binary Worrier
A: 

Marshalling is purely accross a boundary

Usually used to pass objects between 2 appDomains. The over the wire part is an optional thing, but the process of sending the object over the wire is firstly serialization of the object down, the sending is usually by some other protocol (tcp/ip).

Peter