Issue: Programming Language Integration
This document is part of the eXtensible Binary Universal Protocol project documentation. Provides description of protocol's integration into the programming languages.
Object Serialization
It seems to be useful to provide the integration of the XBUP protocol into programming language and with appropriate functions to allow the storage of objects into the appropriate structures. For this purpose, multiple interfaces are defined which allows to individual objects to be allocated some address of the equivalent specifications. Methods for the serialization then should allow an easy transfer into XBUP, which can then further be processed.
In addition to new objects, it is necessary to provide serialization methods for the existing basic types as well as other classes.
Serialization Interface
Perhaps it is possible to transfer certain classes to the blocks, or to groups or complete formats, which is the need to differentiate by adding the appropriate interface. How should this ability be reflected in terms of classes representation is not yet clear.
Alternatively, it is also possible that the class can be transferred to several classes (again, there should be a transformation). Whether this should be allowed or how to make multiple serialization will be dealt with in this document later.
Type Recognition Interface
Serializable classes may dispose function, which returns the type of the final serialized object. Way to distinguish the type of the returned structure may vary:
- Define type for each (block, group, format) separate interface
- Define single interface to distinguish the types of returned items
getXBUPType: XBUPType
XBUPType: class
path: array of UBNatural
itemtype: (block, group, format)
Processing Methods
Serialization itself is provided by toStreamXB and fromStreamXB methods, which work with binary streams and with methods toEventXB and fromEventXB which work with the sequence of XBUP Protocol events.
Object's Transformations
This section describes the relationship between the transformation of buildings and structures of the XBUP Protocol. Most likely the possibility of the conversion of one class to another should be reflected in the existence of an transformation module for equivalency. Own conversion classes in the program is them possible to consider as shortening of the entire process of remote transformations.
Page Source