message in fixed length vs. XML

 
 
I am working on parsing fixed length message encoding in ISO-8859-1 and XML in UTF-8 message with the same content.  One advantage that fixed length over XML is easier to extract a certain substring based on position. It is a lot faster too. For XML to do that, it is a bit of kludge to do 2 String.indexOf()  in Java to find the substring ‘s begin and end,  then extract it with String.substring(). In my case, this substring is Order Id for an order made online by a customer, It made sense that the code peeks into message to get the order id, then look up our DB to see if we have the order id stored in our tables.  Obviously fixed length is efficent in lookup without parsing it.
Advertisements
This entry was posted in java. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s