How would you explain "on the fingers", or with an example of the code, what is it? Here serialization is clear; it is copying structures from-to in a simple form, for example, in the form of a byte stream. And here it is argued that in this case serialization is essentially a marshaling as it implements "pass-by-value semantics". What do you think?

  • 3
    Similar question on SO . You can translate the answer. - D-side
  • I think an article about this msdn.microsoft.com/ru-ru/library/… - Yury Bakharev
  • @D-side, I basically took information from there for my question ... But I wanted to hear it in my own, mighty and great. - Bulson
  • @YuryBakharev is a reference to the documentation that helps to understand a little. Is jial serialization marshaling or not? - Bulson
  • @ Bulson This documentation is an example of the .net object, for me so in the comments it’s difficult to translate, but the main meaning is described, THAT IS REDUCING THE OBJECTS TO SUCH ABSTRACT TYPE WHICH WILL BE CAUSED BY DIFFERENT APPLICATIONS AND CAN BE USED BY VES. Json serialization of what? Strings? XML? - no it is not marshaling imho. - Yury Bakharev

2 answers 2

Marshalling is the transfer of an entity from one context to another. Serialization is an entry as a sequence of elements.

Marshalling is a process of a higher level than serialization. Usually, if you need to transfer a data structure from one process to another, it will be serialized, transferred and deserialized. If the parameter is two-way, then it will have to be transmitted twice, and this will be a single marshalling operation.

Or it is possible to pass by reference, when a proxy object is created on the other side of the channel, and not the internal state of the object, but calls to its methods is transmitted through the channel.

If we are talking about the interaction between managed and unmanaged code - the marshalling is to fix the addresses of objects or copy structures between managed and unmanaged memory, serialization is not used here at all.

  • I accept your answer, but with a reservation, or rather the addition: "So Serialization is part of Marshalling." "In Marshalling Object is serialized (member data is serialzied) + Codebase is attached." - Bulson
  • @Bulson marshalling structures between the managed and unmanaged serialization code does not occur. - Pavel Mayorov 2:28
  • OK got it. I took these quotes from the English version of SO - Bulson

As far as I understand, marshaling and serialization are almost synonyms, except for the fact that marshaling records various additional data that tells the recipient of the object what to take and how to use the code base. We can say that Marshaling is the serialization of data plus the object code base.