Since the communication between ACP Server and Microsoft Add-in is done through network socket communication, the message sent need to be specially formatted so as to keep the structure of the objects intact when sending through the network connection.

Possible Choices

Two popular choices: XML and JSON, are considered.

JavaScript Object Notation (JSON)

Extensible Markup Language (XML)

Pros

Provides scalar data types

Provide ability to express structured data through objects and arrays

Ability to express null object

Pros

Allow use of comments

Support use of namespace to eliminate name collisions

Cons

No concept of namespace: naming collision is avoided by nesting objects

Design Decision Made

Since JSON is more data-oriented and lightweight than XML, JSON is used in ACP to structured the request message before sending it through the network connection. Another reason to use JSON is that it allows ACP Server to return an array of objects (eg. List of suggestion objects) natively to Microsoft Add-in. If no suggestions is retrieved based on the user input, it can also send a null object to the Add-in client.

However, with this design decision made, there is a need to look for Java and .NET libraries to provide function to serialize and deserialize objects into JSON.