[QFJ-564] Operating on (modifying) repeating groups Created: 10/Nov/10  Updated: 10/Nov/10

Status: Open
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.5.0
Fix Version/s: None

Type: Improvement Priority: Default
Reporter: Addy Bhardwaj Assignee: Unassigned
Resolution: Unresolved Votes: 0
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.

Generated at Sun May 05 10:21:07 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.