|
From: Toli K. <to...@ma...> - 2007-10-05 22:35:20
|
Hey, I have a question about no-arg constructors of DateField subclasses, such as SendingTime and TransactTime. It seems that if you use no-arg constructors for these fields, you always get a field with some constant arbitrary time in it. For example: Message msg = new Message(); msg.setField(new TransactTime()); sleep(20 seconds) msg.setField(new SendingTime()); You get the same exact time in both TransactTime and SendingTime fields. This is b/c the no-arg constructors are implemented to get the time from a static Calendar that's part of the DateField superclass, and the Calendar class is implemented to have a static 'current time' value that's initialized once and kept. Is there any particular reason why the no-arg constructor for DateField subclasses has this behaviour? I'd expect that it'd be the equivalent of new SendingTime(new Date()), ie it'd always create a field with the latest time. i'm not sure if this is a bug or a C++ QF compatibility issue, but i can't think of a use case where you'd want this behaviour. It's not even returning the time the FIX engine started - it's just some arbitrary time when the very first DateField was created. thoughts? -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. |