We are developing a system for processing XML messages.
The processing of a Java class requires the separation of various attributes and values ββfrom large XML and passing them as parameters to individual handler classes for various operations.
We thought about the following options:
BUT)
Pass all the XML to each handler and let it extract the appropriate bits - but feel like it might be inefficient to pass XML every time
IN)
Convert XML to DTO or a set of smaller DTOs and pass each DTO to the appropriate handler
FROM)
Cut the XML into fragments and pass them to each handler method
We are not happy with each of them, so any suggestions, where to go?
XML example
<IdAction>supplied</IdAction> <RegId>true</RegId> <DeRegId>false</DeRegId> <SaveMessage>false</SaveMessage> <ServiceName>abcRequest</ServiceName> <timeToPerform>3600</timeToPerform> <timeToReceipt/> <SendToBES>true</SendToBES> <BESQueueName>com.abc.gateway.JMSQueue.forAddRequest</BESQueueName> <BESTransform/> <BESJMSProperties> <property> <propName>stateCode</propName> <propValue>OK</propValue> </property> <property> <propName>stateResponse</propName> <propValue>OK</propValue> </property> </BESJMSProperties>
It contains 4 blocks processed by 4 handlers that make
<IdAction>supplied</IdAction> <RegId>true</RegId> <DeRegId>false</DeRegId>
another does
<timeToPerform>3600</timeToPerform> <timeToReceipt/>
next does
<SendToBES>true</SendToBES> <BESQueueName>com.abc.gateway.JMSQueue.forAddRequest</BESQueueName> <BESTransform/> <BESJMSProperties> <property> <propName>stateCode</propName> <propValue>OK</propValue> </property> <property> <propName>stateResponse</propName> <propValue>OK</propValue> </property> </BESJMSProperties>
etc.
java oop
romesub
source share