New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interface: Questions about property inheritance of the MessageContext object #1001
Comments
That's a great catch, thanks! I agree that it should be possible to create a messageContext independent of Connection/Selection properties. A static default may be bad: one may e.g. always have msgOrdered=true, not care about it, and never be able to benefit from a Connection that can do msgOrdered=false. So, instead, I'm tempted to suggest that the default will be assigned (unless the value has been specifically assigned with "add" as in your example above) based on Connection/Selection properties upon use - during the Send call. But this also easily gets bad: it would be an easy mistake to miss this in a TAPS Transport System implementation, and ... if I want to read the value of this parameter of the messageContext, what do I get? Maybe we could define a new special value: "to be updated upon use" ? Tricky. Ideas, anyone? |
In my implementation, I've tentatively changed the This has a number of advantages:
Note that this setup alone does not allow the |
Interesting! I don't think we should spec it using the Preference type though (seems like a bit of a hack: a "Preference" isn't what this is, and the re-interpretation of Avoid and Prefer isn't too nice either... but that's ok for an implementation!). We could have the type definition as follows: ... and we could explain that If folks agree with this, I can make a PR. |
I guess making this inheritance mechanism more obvious could really help here. But using "ignore" for "inherit" or "default" is a bad choice, though. When designing this, we rather thought the message context to be something like a dictionary, where we put all "changes" we want to apply to the message, but making it somewhat of a strongly typed object may require constructing it from the connection in order to derive the defaults. |
Agreed with @philsbln. We should make the inheritance of properties from connection-wide preferences onto messages more clear. |
Suggestion: In 9.1.3, explain that if you don't set a specific property on a message, the connection/selections properties apply based on what the connection has, and the ones that don't inherit from a connection just use their default. |
[Note to self] ... and additionally put specific text about this in the description of the properties where the default is described as "inheriting" from the Connection. |
Section 9.1.3 of the API Draft states:
At this point, the reader gains the impression that
messageContext
is created independently of any Connection/Selection Properties.However, Section 9.1.3.7 goes on to state:
This raises numerous questions:
MessageContext
object is created?NewMessageContext()
take the current Selection Properties as an argument?)Reliability: Prefer
even meaningfully map to a Boolean?(Note that the
msgOrdered
property from Section 9.1.3.3 raises similar questions)The text was updated successfully, but these errors were encountered: