1 / 9

Serialization and XML

Serialization and XML. Pat Palmer 2.0. What is serialization?. “The process of converting an object (or a graph of objects) into a linear sequence of bytes for either storage or transmission to another location.” . What is deserialization?.

stesha
Download Presentation

Serialization and XML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Serialization and XML Pat Palmer2.0

  2. What is serialization? “The process of converting an object (or a graph of objects) into a linear sequence of bytes for either storage or transmission to another location.”

  3. What is deserialization? “The process of taking in stored information and recreating objects from it.” • Wikipedia currently has a decent overview of serialization • http://en.wikipedia.org/wiki/Serialization

  4. how to deserialize badly • If a program is both the serializer and deserializer, things are straightforward. • If a program receives a serialized file from another company: • What does the program need to know to rebuild an identical object in memory? • Text or binary format • If binary, need to know everything • If text, what byte encoding? • If valid XML, we can at least read in the data • But whether we know what to do with it is uncertain

  5. some serialization formats • Binary • .csv • XML • SOAP • JSON • Protocol Buffers

  6. uses of XML serialization format • saving program state (“settings”) between executions • sharing data between companies • Purchase orders, course enrollments, catalogs, news feeds, etc. • platform-independent Remote Procedure Calls (RPC’s) • plain text passes through firewalls if attached to email • or sent as the payload of an HTTP request • human-readable and machine readable • both data and metadata (data about data), and thus self-describing • unrecognized elements can be ignored during deserialization

  7. XML serialization: the bad • some folks object to using XML as the RPC message format • efficiency concerns • XML typically creates larger files than a binary, proprietary format does • The larger the document, the longer it takes to transmit over a network • privacy and security • inherently insecure because human readable • goes through firewalls

  8. REpresentational State Transfer (REST) • HTTP GET requests (parameters in the URL) are RESTful • E.g., Google Charts API, HTML validator links, Amazon books • the URL’s get ugly, and are limited in length by browsers • Also, a philosophy promoted in blogs with the following claims: • every object that can be retrieved over a network should have a unique URL that can be used to bookmark it • XML is too bulky for shipping over the network, if more concise “platform independent” formats are available as alternatives • REST has been promoted by employees of Sun, Apple, and IBM, while Microsoft strongly supported the XML standard and adopted RPC using SOAP (a special version of XML) • Some REST drawbacks: no authentication scheme, no transactions, no standardized error reporting mechanism, no formal contract definitions

  9. The End I think part of a best friend's job should be to immediately clear your computer history if you die. -Anonymous

More Related