You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Serialisation is the process of creating a linear stream of bytes or characters corresponding to an object structure (a graph), so the same structure can be re-constructed by de-serialising the stream. This technique is used both to save the object structure to file and to transmit it across a network.

Introduction

Persistence is the term used for storing (application) state in between sessions, in our case model instances represented by objects structures (graphs), and covers file and database storage, including SQL, object and NoSQL databases. The logic of files and databases are so different that it is easier to treat them separately. A file is essentially a sequence or array of bytes, which often encode characters, and serialisation is the term used for mapping the object structure to byte or character sequences. Although files are mostly meant for consumption by programs, they often need to be edited by hand, so a serialisation format should ideally be human-readable and to some extent editable.

Model instances are graphs in general, but it is easier to think of them as mostly hierarchical, with links across. Hence, a serialisation mechanism will typically need to support the following features:

  • type information for model instances, i.e. references to EClasses in the model
  • attributes, corresponding to EAttributes, and their values, which typically serialisable as strings
  • containment, corresponding to EReferences marked as such
  • links (across), corresponding to EReferences, and their values, which are object identities

Note that at least links, but also containment, could be across files, 

Resources, resource factories and resource sets

 

 

XML-based formats

EMF has support for XML-based 

  • No labels