Difference between revisions of "JSON Integration Adapter Code Review 1 Changes"

From CDOT Wiki
Jump to: navigation, search
(Design Document)
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Admon/obsolete}}
 +
 
[[category: NexJ Express JSON Message Adapter]]
 
[[category: NexJ Express JSON Message Adapter]]
  
Line 10: Line 12:
 
* Create localization strings in en.strings
 
* Create localization strings in en.strings
 
* Use message part as argument to exceptions and not the whole message
 
* Use message part as argument to exceptions and not the whole message
|  
+
| Complete for formatter, may be revisited for parser
 
|-  
 
|-  
 
| Documentation
 
| Documentation
Line 21: Line 23:
 
* Lines that create new Objects should be between newlines
 
* Lines that create new Objects should be between newlines
 
* Add newline before break  
 
* Add newline before break  
 +
| Complete for now (revisit later)
 
|}
 
|}
  
Line 32: Line 35:
 
* Replace screenshots of Messages with valid messages (some values where missing type)
 
* Replace screenshots of Messages with valid messages (some values where missing type)
 
* Make note of any normally standard features which are not implemented by the JSON parser/formatter
 
* Make note of any normally standard features which are not implemented by the JSON parser/formatter
|
+
* Add section about required parts and null values
 +
* Add section about channels with multiple messages
 +
| Complete
 
|}
 
|}
  
Line 39: Line 44:
 
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"
 
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"
 
|-
 
|-
! Issue
+
! Task
! Description
 
 
! Status
 
! Status
 
|-  
 
|-  
 
| Use Hashholder instead of HashSet
 
| Use Hashholder instead of HashSet
| Use HashHolder in the XMLJSONMessagePartLoader instead of HashSet and whenever appropriate replace HashSet with HashHolder
+
| Complete
|
 
 
|-  
 
|-  
| Change 0x000 for byte
+
|byte initialization
| For root modes, change 0xXXX to a cast to byte. Also do not use leading zeroes.
+
* Remove leading zeros
|
+
| Complete
 
|-  
 
|-  
| Remove StringParsre from JSONMessagePartMapping
+
|StringParser
| Either remove StringParser from the mapping, or use it in formatting primitives. Do not leave it in if it is not used.
+
* Remove if not needed
|  
+
| Complete
 
|-  
 
|-  
| Create class called RootJSONMessagePartMapping
+
| RootJSONMessagePartMapping
| Create a class called RootJSONMessagePartMapping for each CompositeMessagePart. This root JSON mapping will handle the "mode" for each CompositeMessagePart.
+
* Create class RootJSONMessagePartMapping
|  
+
* Extend JSONMessagePartMapping and move all root settings to this.
 +
| Complete
 
|-  
 
|-  
| Allow root modes for each CompositeMessagePart
+
| Composite Message Part modes
| Rename root mode to mode, so that each CompositeMessagePart can use every type of mode.
+
* Rename root mode to mode
|  
+
* Allow all composite message parts to have a mode
 +
| Complete
 
|-  
 
|-  
| Rename m_sFormat
+
| m_sFormat
| Rename the variable m_sFormat if not used (or use it and keep the name).
+
* Remove if not needed
|  
+
| Complete
 
|}
 
|}
 
  
 
===== JSONMessageParser =====
 
===== JSONMessageParser =====
 
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"
 
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"
 
|-
 
|-
! Issue
+
! Task
! Description
 
 
! Status
 
! Status
 
|-  
 
|-  
| Remove/Use InvocationContextAware
+
| InvocationContextAware
| Do not implement the invocation context aware interface if not used by the class. Or, use the interface for formatting of primitives.
+
* Do not implement the invocation context aware interface if not used by the class
|  
+
| Complete
 
|-  
 
|-  
| Name methods XXXPart, not XXXNode
+
| Rename methods XXXNode to XXXPart
| Rename methods to be XXXPart, for example as writeCompositeMessagePart, instead of writeCompositeMessageNode.
+
| Complete
|  
 
 
|-  
 
|-  
| Wrap fail
+
| fail
| Wrap all instances of fail with IntegrationException.
+
1. Wrap fail so that is throws expection right away<br>
|  
+
2. Move fail statements from bottom to top, remove else clauses
 +
| 1. Complete <br>
 +
2. Incomplete
 
|-  
 
|-  
| Override JSONParse
+
| parse()
| Override parse method of JSONParser in the JSONMessageParser class. Do this to avoid changing JSONParser.
+
* Override parse method of JSONParser to always return a TransferObject
 
|  
 
|  
 
|-  
 
|-  
| Use primitive formatter when reading.
+
| parsing primitive values
| When reading information in from a stream in the formatter, use primitive formatter to determine the correct format of a primitive.
+
* Use primitive formatter on values that are parsed before storing them
|  
+
| Complete
 
|}
 
|}
 
  
 
===== JSONMessageFormatter =====
 
===== JSONMessageFormatter =====
 
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"
 
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"
 
|-
 
|-
! Issue
+
! Task
! Description
 
 
! Status
 
! Status
 
|-  
 
|-  
| Format primitive values before outputting to writers.
+
| Format primitive values
| Use the StringFormatter to format primitive values before outputting to the writer. For example, timestamps must be formatted before outputting to the writer.
+
* Make of use of mapping.getFormat()
|  
+
| Complete
 
|-  
 
|-  
 
| Pass enumerations into formatMessageRoot
 
| Pass enumerations into formatMessageRoot
| Do not use member/class variables for storing information unless absolutely necessary. Prefer to pass parameters around so that objects do not grow large as the parser/formatter iterates.
+
* Do not use member/class variables for storing information unless absolutely necessary
|  
+
| Complete
 
|}
 
|}

Latest revision as of 20:52, 26 January 2014

Important.png
This page may be obsolete.
It contains historical information.
General
Tasks Status
Exception
  • Create localization strings in en.strings
  • Use message part as argument to exceptions and not the whole message
Complete for formatter, may be revisited for parser
Documentation
  • Add documentation to all methods and members
  • Use full English sentences
Code Style
  • Apply NexJ Code Style
  • Lines that create new Objects should be between newlines
  • Add newline before break
Complete for now (revisit later)
Design Document
Task Status
Update Design Proposal Document
  • Replace screenshots of Messages with valid messages (some values where missing type)
  • Make note of any normally standard features which are not implemented by the JSON parser/formatter
  • Add section about required parts and null values
  • Add section about channels with multiple messages
Complete
JSONMessagePartMapping
Task Status
Use Hashholder instead of HashSet Complete
byte initialization
  • Remove leading zeros
Complete
StringParser
  • Remove if not needed
Complete
RootJSONMessagePartMapping
  • Create class RootJSONMessagePartMapping
  • Extend JSONMessagePartMapping and move all root settings to this.
Complete
Composite Message Part modes
  • Rename root mode to mode
  • Allow all composite message parts to have a mode
Complete
m_sFormat
  • Remove if not needed
Complete
JSONMessageParser
Task Status
InvocationContextAware
  • Do not implement the invocation context aware interface if not used by the class
Complete
Rename methods XXXNode to XXXPart Complete
fail

1. Wrap fail so that is throws expection right away
2. Move fail statements from bottom to top, remove else clauses

1. Complete

2. Incomplete

parse()
  • Override parse method of JSONParser to always return a TransferObject
parsing primitive values
  • Use primitive formatter on values that are parsed before storing them
Complete
JSONMessageFormatter
Task Status
Format primitive values
  • Make of use of mapping.getFormat()
Complete
Pass enumerations into formatMessageRoot
  • Do not use member/class variables for storing information unless absolutely necessary
Complete