An Intro to External Data Representation and Marshalling

External Data Representation (XDR)

XDR is a standard data serialization format that can be used to transmit data among different computer architectures. Conversion of data from local representation to XDR is called encoding and conversion from XDR to a local representation is called decoding. XDR implementations are portable between different operating systems and independent of the transport layer.

Marshalling

Marshalling is the process of transforming a collection of data items into a form that is suitable for transmission in a message. At the destination, the message is unmarshalled to produce the relevant data items. In other words, marshalling converts structured data items and primitive values into an external data representation, and unmarshalling generates primitive values from their external data representation and rebuild the data structures.

CORBA’s Common Data Representation (CDR)

Common Object Request Broker Architecture or CORBA for short is a standard defined by Object Management Group (OMG) to facilitate the communication among diverse platforms. Common Data Representation aka CDR is used in CORBA distributed objects during remote invocations to represent structured or primitive data types that are passed as arguments or results.

CORBA Common Data Representation

Java Object Serialization

Java provides automatic serialization to the primitives data types and objects that are marked as serializable by implementing either java.io.Serializable or java.io.Externalizable interfaces. These serializable objects then can be used as arguments and results in Java Remote Method Invocation(RMI).

Extensible Markup Language (XML)

XML is a markup language that defines a set of rules for encoding data in a format that is both human and machine-readable. It was introduced by the World Wide Web Consortium(W3C) for general use on the web. XML uses a textual encoding to represent both its data and the structure.

<?xml version="1.0"?>

<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">

<soap:Body>
<m:GetPrice xmlns:m="https://www.w3schools.com/prices">
<m:Item>Apples</m:Item>
</m:GetPrice>
</soap:Body>

</soap:Envelope>

Conclusion

  • Even though programs represented data using data structures at runtime, they need to be converted into sequences of bytes before transmitting to another system.
  • External Data Representation is a standard data serialization format that can be used to transmit data among different computer architectures.
  • Marshalling is the process of transforming a collection of data items into a form that is suitable for transmission in a message. Unmarshalling is the reverse process.
  • CORBA’s CDR, Java object serialization and XML are the three different approaches to external data representation and marshalling.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store