Serialization

Entity data, i.e. complex data structures of moderate volume, are often represented as XML in the ALMA system. According to the ALMA Technical Architecture described in the ALMA Software Architecture[RD33], XML is used to:

The primary language used to define data entities in ALMA is UML, c.f. ALMA Software Architecture[RD33].

UML is used as a higher-level layer, from which the previously hand-crafted XML Schemas are now automatically generated. The data transport format will remain XML though, and the XML schemas are still visible to developers when defining database queries.

Support for data modeling, code generation, and data handling in ALMA is split between ACS and the HLA subsystem:

We assume that access to entity data will be primarily of concern to Java high level applications, therefore ACS priority is to provide optimal support for Java.

Entity data structures are conceptually defined as UML classes. Technically they are defined by means of XML Schemas which are derived automatically from UML.

Programming language classes (for example Java, C++ and Python) to wrap and facilitate access to entity structures could be generated automatically from the XML Schema (XML binding to language-specific classes). The Castor[RD36] open source framework is currently used for Java binding. Castor XML binding provides also validation code for the accessors, based on the XML Schema. A similar, but not as complete, open-source binding framework for Python, generateDS, will be delivered with ACS 8.0. No such facility is currently foreseen (or required) for C++.

For data structures defined in UML, code generators are based on the Open ArchitectureWare Project [RD39] generator framework. We generate from the XMI UML representation:

Entity data is passed among Components as XML strings[RD01 - 10.5.10 XML]. Each Component operation that sends/receives an entity data structure, will have an IDL interface where the corresponding parameter is represented as a CORBA string. This is a commonly accepted way of implementing serialization. [RD01 - 3.3.2. Serialization] and migration[RD01 - 3.3.3. Migration] of objects without using CORBA Object by Value (ObV). As already mentioned in the Error System section, ObV is not implemented by most ORBs, is still immature and its usage is problematic.

ACS Java Container makes (un)-marshalling transparent to the user, interposing a proxy class between the IDL stub/skeleton and the implementation:


Figure 3.16: Example of class diagram showing transparent Entity Data serialization

 

The usage of the proxy approach allows the container to:

For C++ and Python it is not foreseen to implement transparent (un-)marshalling like in Java. This choice is based on the assumption that Java clients and Components will be the most adequate whenever serialization is needed. If C++ and Python support will be necessary, they will be implemented at a later stage based on the code generation engine (Not implemented yet).

In case no XML binding generator is available (for example for clients written in a language different from Java, C++ or Python), we anyway expect that it will be acceptable to work directly on the XML strings with an XML parser.