Marshalling (computer science)

The accurate definition of marshalling differs across programming languages such as Python, Java, and .NET, and in some contexts, is used interchangeably with serialization.

The unmarshaller interface automatically converts the marshalled data containing codebase(s) into an executable Java object in JAXB.

In Microsoft's Component Object Model (COM), interface pointers must be marshalled when crossing COM apartment boundaries.

The Mozilla Firefox browser is a popular application built with this framework, that additionally allows scripting languages to use XPCOM through XPConnect (Cross-Platform Connect).

Microsoft, for example, uses it as the basis of the file formats of the various components (Word, Excel, Access, PowerPoint, etc.)

While this typically results in a verbose wire format, XML's fully-bracketed "start-tag", "end-tag" syntax allows provision of more accurate diagnostics and easier recovery from transmission or disk errors.

In addition, because the tags occur repeatedly, one can use standard compression methods to shrink the content—all the Office file formats are created by zipping the raw XML.

[10] Alternative formats such as JSON (JavaScript Object Notation) are more concise, but correspondingly less robust for error recovery.

Once the data is transferred to a program or an application, it needs to be converted back to an object for usage.

One of the advantages of C# over Java is that C# natively supports marshalling due to the inclusion of XmlSerializer class.

Java, on the other hand requires a non-native glue code in the form of JAXB to support marshalling.

The unmarshal methods defined in the Unmarshaller class are overloaded to accept XML from different types of input such as a File, FileInputStream, or URL.

[14] When the root element is not declared globally, the application assists the unmarshaller by application-provided mapping using declaredType parameters.

However, if the @xsi:type attribute of the XML data has a mapping to an appropriate JAXB class, then this takes precedence over declaredType parameter.