RE: [Quickfix-developers] Component blocks
Brought to you by:
orenmnero
|
From: Shepheard, T. (London) <Tob...@ml...> - 2006-01-18 14:56:58
|
I make it look a bit worse than it is - fieldMap.getField can of course take a TransactTime object rather than the base type, which protects it against data dictionary changes and the need to know the base type.=20 =20 Still, the question around using component blocks in an OO manner remains :) -----Original Message----- From: qui...@li... [mailto:qui...@li...] On Behalf Of Shepheard, Toby (London) Sent: 18 January 2006 14:52 To: qui...@li... Subject: [Quickfix-developers] Component blocks =09 =09 Hi all,=20 I'm using QuickFIX/J, though I think this may be applicable to the other implementations I'm not sure.=20 What I'd like to do is write some helper methods to carry out certain common actions based on component blocks. A typical example would be the Instrument block, which appears in a number of guises: QuoteRequest message - here it is part of a repeating group, NoRelatedSym.=20 NewOrderSingle message - here it is part of the main NewOrderSingle message=20 I'd love to be able to pass in an "Instrument" object to a method and do my thing with it, but there doesn't seem to be any such object. Indeed, the only way I could find to extract Instrument data from a common base class was to treat is as a FieldMap object, which covers both Group and Message types. This seems to mean using a format such as fieldMap.getField(new UtcTimeStampField(TransactTime.FIELD)=20 Which is not very type-safe, as I'm just assuming the fieldMap will have the Instrument block's fields, and is liable to break if anything changes in the underlying data-dictionary. Is there a better way to do this that is type-safe and reusable, regardless of the underlying fieldMap type that the instrument block is a part of? I realise component blocks have no "real" meaning, but they do provide a common, logical construct that it seems shame I can't leverage in a nice OO way, especially considering the data dictionary contains all the required data for generating such objects. If I am missing something, please let me know :) Regards,=20 Toby -------------------------------------------------------- If you are not an intended recipient of this e-mail, please notify the = sender, delete it and do not read, act upon, print, disclose, copy, = retain or redistribute it. Click here for important additional terms = relating to this e-mail. http://www.ml.com/email_terms/ -------------------------------------------------------- |