Details
-
Type: Improvement
-
Status: Open
-
Priority: Default
-
Resolution: Unresolved
-
Affects Version/s: 1.5.0
-
Fix Version/s: None
-
Component/s: Engine
-
Labels:None
-
Environment:N/A
Description
Currently if you want to add a value in a repeating group, there isn't a straightforward way of doing so. For instance,
//Just for illustration, if noSides group is read from TCR
TradeCaptureReport.NoSides noSidesGroup = new TradeCaptureReport.NoSides();
tradeCaptureReport.getGroup(1, noSidesGroup);
//add account information in TCR
noSidesGroup.set(new Account("accountA"));
This action doesn't modify the original TCR message as the group returned by getGroup() method is a copy of the actual group object.
Is there a reason for this behaviour? Also, I noticed that when we add a typed group object it is copied into a Group object and then stored in the underlying TreeMap of groups. The only reason I could find is that String to Object parsing doesn't create concrete group objects hence copy is required but I hoping there is another reason that I have overlooked.
ps: I have modified source code locally to improve this behaviour by
- Removing the copy behaviour all together so concrete groups objects are kept in the message object
- parsing string to QUICKFIXJ message object handles creation of concrete Groups as well.
I am more than happy to provide a patch if it this functionality is desirable. It should surely help optimise the code by reducing copies and object creation.