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

From CDOT Wiki
Jump to: navigation, search
(JSONMessageParser)
(JSONMessageFormatter)
Line 98: Line 98:
 
{| 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()
 
|  
 
|  
 
|-  
 
|-  
 
| 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
 
|  
 
|  
 
|}
 
|}

Revision as of 15:53, 10 August 2011


General
Tasks Status
Exception
  • Create localization strings in en.strings
  • Use message part as argument to exceptions and not the whole message
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
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
JSONMessagePartMapping
Task Status
Use Hashholder instead of HashSet
byte initialization
  • Remove leading zeros
StringParser
  • Remove if not needed
RootJSONMessagePartMapping
  • Create class RootJSONMessagePartMapping
  • Extend JSONMessagePartMapping and move all root settings to this.
Composite Message Part modes
  • Rename root mode to mode
  • Allow all composite message parts to have a mode
m_sFormat
  • Remove if not needed
JSONMessageParser
Task Status
InvocationContextAware
  • Do not implement the invocation context aware interface if not used by the class
Rename methods XXXNode to XXXPart
fail
  • Wrap fail so that is throws expection right away
  • Move fail statements from bottom to top, remove else clauses
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
JSONMessageFormatter
Task Status
Format primitive values
  • Make of use of mapping.getFormat()
Pass enumerations into formatMessageRoot
  • Do not use member/class variables for storing information unless absolutely necessary