What is object marshalling?

后端 未结 10 904
后悔当初
后悔当初 2020-12-13 01:42

I have heard this concept used frequently, but I don\'t have a really good grasp of what it is.

相关标签:
10条回答
  • 2020-12-13 02:22

    I clarified a google search to "data marshalling" and the first hit was on some place called webopedia which is pretty good. The gist is that you transform data back and forth to a form for things like transmission over a network. The problem it solves is that you can't really transmit data over a network in a form that is usable by a program. You have to solve a number of issues including things like endianness of data, how you store complex data types like strings, etc.

    Marshalling is not just to solve network transmission problems but other problems such as going from one architecture to another, maybe different languages especially those that might use things like virtual machines, and other "translation" problems.

    0 讨论(0)
  • 2020-12-13 02:26

    It means turning any data into another data type to transfer to another system.

    E.g., marshalling a struct into an XML document to send to the webservice, or marshalling a pointer to send to a different thread apartment.

    0 讨论(0)
  • 2020-12-13 02:28

    Converting an object in memory into a format that can be written to disk, or sent over the wire, etc.

    Wikipedia's description.

    0 讨论(0)
  • 2020-12-13 02:32

    Marshalling is the process of transferring data across application boundaries or between different data formats. Marshalling is very common, for example writing data to disk or to a database is technically marshalling, however the term tends to be used to describe data conversion for "foreign" APIs or for interprocess communication.

    For example, in .NET, communicating between managed and unmanaged code (such as accessing certain win32 APIs) will likely require marshalling in order to convert back and forth between managed C# objects and C/C++ style objects (structs, handles, output buffers, etc.) The help for the static Marshal class might be helpful.

    0 讨论(0)
提交回复
热议问题