Serialization

An Interface is a construct that can be used to define the format of an XML message. This follows the object oriented concept of interfaces in which they form a contract between a client and the implementing class and define the format of data that is passed in and out of the class.

Serialization is an interface construct that is used to allow message structures, such as XML to be modelled in Agile Business Suite. The term Serialization refers to the fact that the data can be serialized to and from message formats like XML. You can use the Serialization to define any structured message format as it is not tied to any specific message format.

Note: In AB Suite 7.0 Serialization to and from XML messages is supported, and other message formats, such as JSON might be supported in the future.

The content and structure of an XML message can be defined through one or more Serializations. The Serialization comprises attributes that define individual primitive elements and other Interfaces that define complex sub-elements.

The AB Suite model can contain a definition of the message structure as a Serialization, and can also contain a corresponding class that implements the Serialization. At runtime, the XML message is de-serialized according to the Serialization definition and the XML element data is populated into the attributes of an instance of the corresponding class. This AB Suite instance can then be processed internally through certain business rules implemented as LDL+ logic.

The following figure illustrates how the message can be modelled, with the layout of the message modelled through the Serialization interface definitions. It also illustrates how the behavior and processing can be implemented in the corresponding class definitions, which are said to ‘implement’ the interfaces. For example, the classes can contain LDL+ logic within their methods to store the XML data in database tables.

There are two types of classes that can be used to implement Serialization and process message data:

A Messenger class is a stereotyped class with Stereotype=“Messenger”. It includes built-in behaviors allowing it to process incoming messages.

A Serializable class is an ordinary class (not Stereotype) that is used to implement the handling of all or part of a message by implementing a Serialization.