Open main menu

CDOT Wiki β

Changes

JSON Integration Adapter

210 bytes removed, 08:33, 8 July 2011
no edit summary
[[category: NexJ Current Projects]]
[[category: NexJ Express JSON Message Adapter]]
 
== Overview ==
{| class="wikitable" border="1"
|-
! Term
! Description
|-
| Formatter
| Turns data into JSON
|-
| Parser
| Turns JSON into data
|-
| Message
| The metadata to be used when formatting and parsing a message. The grammar. It is a tree-like structure.
|-
| MessageInstance
| The information to be parsed or formatted
|}
 
The goal of JSON Integration Adapter is to give the NexJ Express Integration Layer the ability to work with JSON data.
 
The Integration layer allows a Model to interact with external applications asynchronously. A description / grammar of the data to be exchanged between the two systems is defined using a Message in the Model.
 
Formatting is turning internal NexJ representation of a MessageInstance into JSON. The formatter is given a Message (the grammar), MessageInstance (the data), and a pipe. This accomplished by walking the Message tree-like structure while validating the data in the MessageInstance and streaming JSON format to the pipe. If the data in the MessageInstance does not conform to the Message, the formatter throws an exception.
 
The parser turns JSON representation of a MessageInstance into an internal NexJ representation of a MessageInstance. The parser is given a Message (the grammar) and an input stream. First the input stream is parsed for JSON using a JSONParser which returns either an Object or an Array. The formatter walks the Message building the structure of the MessageInstance and adding validated values in the object returned by the JSONParser to the MessageInstance. If the data from the input stream does not match the expected input at any time, the parser throws an exception.
 
== Project Repository ==
 
https://bitbucket.org/b_lim/nexj-express-json-integration-adapter/overview
 
== Project Goal==
To create an adapter for the NexJ Core similar in methodology and design of existing message adapters (XML, Fixed, CSV etc.) but using the JSON format
 
===Contributors===
* [[User:Gbatumbya|Grace Batumbya]]
* [[User:Brianlim | Brian Lim]]
 
== Current Status==
Currently in the middle of Phase IV.
 
==Project Phases==
JSON Integration Adapter Phases
 
===Phase I. Research (DONE)===
# Complete NexJ Integration tutorial
# Install NexJ Studio Express from source
 
===Phase II. Design Proposal (DONE)===
# Receive approval for JSON formatting options
# [https://docs.google.com/document/d/1ecNB98sOqjMcGjEjrmRl5aBt1WSmLNotCxTRvZ6M0h4/edit?hl=en_US Final Project Proposal]
 
===Phase III. Message Formatter (DONE)===
# Resolve issues with second set of unit tests
# Refactor and code message formatter
 
===Phase IV. Message Parser (50% DONE) ===
# Resolve issues with second set of unit tests
# Refactor
 
===Phase V. Integration and Stress Tests===
# Test Message Formatter and Message Parser with integration and stress tests
# Test through NexJ Studio Express GUI (manual testing)
 
===Phase VI. Internal Code Review===
# Internally review code at CDOT
 
===Phase VII. Optimization===
# Find more code optimizations relevant to Enterprise environments
 
===Phase VIII. First Code Review at NexJ===
# Date TBA
 
===Phase IX. Code Rewrite===
# Rewrite code to conform with NexJ suggestions and standards
 
===Phase X. Second Code Review at NexJ===
# Date TBA
 
===Phase XI. Project Completion===
 
== Project Repository ==
BitBucket : https://bitbucket.org/b_lim/nexj-express-json-integration-adapter/
 
== Technical Notes ==
  === Message Details Definitions =={| class="wikitable" border="1"|-! Term! Description|-| Formatter| Turns data into JSON|-| Parser| Turns JSON into data|-| Message| The metadata to be used when formatting and parsing a message. The grammar. It is a tree-like structure.|-| MessageInstance| The information to be parsed or formatted|} Because the Integration layer allows a Model to interact with external applications asynchronously, a description / grammar of the data to be exchanged between the two systems is defined using a Message in the Model.  * Formatting is turning internal NexJ representation of a MessageInstance into JSON. The formatter is given a Message (the grammar), MessageInstance (the data), and a pipe. This accomplished by walking the Message tree-like structure while validating the data in the MessageInstance and streaming JSON format to the pipe. If the data in the MessageInstance does not conform to the Message, the formatter throws an exception. * Parsing is turning JSON representation of a MessageInstance into an internal NexJ representation of a MessageInstance. The parser is given a Message (the grammar) and an input stream. First the input stream is parsed for JSON using a JSONParser which returns either an Object or an Array. The formatter walks the Message building the structure of the MessageInstance and adding validated values in the object returned by the JSONParser to the MessageInstance. If the data from the input stream does not match the expected input at any time, the parser throws an exception. 
==== Message Fundamentals ====
 
Message - Messages can contain values or other messages. The red nodes are messages, the green nodes are values.
1
edit