We have a java application that processes different types of financial transactions. These transactions have different flows and for system flexibility(esp user) we introduced an xml that we use to define the transaction flow for each. The xml looks like this
<transaction code="201510" name="deposit">
<step id="1" name="momo.debit" script="step-1" result="0000" nextid="2">
<error code="0104" script="err-0104"/>
<error code="5008" script="$err-0301"/>
<error code="03**" script="err-0300"/>
<error code="50-98" script="err-5000"/>
</step>
<step id="2" name="deposit" script="step-2" result="0000" nextid="3">
<error code="0105" script="err-0105" hook="2" />
<error code="0203" script="$err-5000" hook="2"/>
<error code="0205" script="$err-5000" hook="2"/>
<error code="0206" script="$err-5000" hook="2"/>
<error code="6100" script="err-5100" hook="2"/>
<error code="5001" script="$err-5101" hook="2"/>
<error code="5002" script="$err-5101" hook="2"/>
<error code="5003" script="$err-5101" hook="2"/>
<error code="5004" script="$err-5102" hook="2"/>
<error code="5005" script="$err-5104" hook="2"/>
<error code="5006" script="$err-5105" hook="2"/>
<error code="50-59" script="$err-5107" hook="2"/>
<error code="6000" script="$err-5108" hook="2"/>
<error code="6005" script="$err-5106" hook="2"/>
<error code="60-99" script="$err-5000" hook="2"/>
</step>
<step id="3" name="notify" script="$notify" result="*"/>
</transaction>
Synopsis
Each step contains a step script, expected result of the step script, error correction scripts incase the step script fails and also intercepting scripts called hooks which perform some work before executing the step script or error script.
Question
I have a working solution already but I feel it's not the best. Now that we are doing performance tests I have detected that the processing is slow and I believe it can be better. What data structure would you recommend to map this xml and/or a design pattern ? I hope this is doesn't feel like an open ended question. Thank you
Aucun commentaire:
Enregistrer un commentaire