Re: [Quickfix-developers] Message creation
Brought to you by:
orenmnero
|
From: <OM...@th...> - 2003-01-03 21:47:35
|
Ah yes, you are right about fromString. I think that it should be made
public. The equivalent C++ method setString is public already.
What you are doing right now, although a little convenient, is ok. In fact
it is very similar to how the JNI library does it.
--oren
gary.mui@sungard.
com To: OM...@th...
cc: qui...@li...,
01/03/2003 02:54 qui...@li...
PM Subject: Re: [Quickfix-developers] Message creation
You're right on the Constructor. I guess a constructor can't return a
derived class, can it?
But it probably belongs in MessageFactory like you say, but I can't find
any fromString method in MessageFactory (I am using the 1.3.2
distribution). The fromString in Message is a private native method.
Am I not looking in the right place? For now, is it a problem for me to do
this for now as described below?
Thanks,
Gary Mui
Prescient Markets, Inc 914-989-3118 (W)
445 Hamilton Avenue 914-422-3693 (F)
White Plains, NY 10601
Please visit us at http://www.cpmarket.com
OMiller@though
tworks.COM To: gar...@su...
cc:
qui...@li...,
01/03/03 03:39
qui...@li...
PM Subject: Re:
[Quickfix-developers] Message creation
>> It would be nice if the Message constructor (taking a String value)
could
>> do this automatically. In order to this, I needed to make the
>> Message.initFromString(String str) method public instead of protected.
>> Is this a reasonable request? Or is there an easier way to create a
>> message object?
I'm not sure how the message constructor can do this automatically. Once
in the constructor you are already creating a message object and not one of
the derived objects you need. Am I misunderstanding you? Do you mean
maybe to have a create method on the MessageFactory that takes in a string?
In any case you do not need to make initFromString public as there already
is a public method called fromString. initFromString is designed to be
called from constructors because it creates an underlying C++ class.
>> Another related question is what happens if you request a message (via
>> sequence number) from the MessageStore but it doesn't exists? I'm going
to
>> have the client basically ask for all messages since (lastMsgRecvd + 1).
Depends on which method you use. If you use the signature for requesting
one message, it will return false if not available. If you use the method
for requesting a range, it will return a collection with whatever is
available. So if you have 1-50, and ask for 30-60, you will get 30-50.
|