-
Notifications
You must be signed in to change notification settings - Fork 63
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
EventAffordance cannot describe contentType of event messages #812
Comments
I like the first proposal. However, I think this might be a too big of an addition for the current TD version. |
Let me clarify to avoid misunderstandings, as you speak of "too big an addition". I think we NEED an additional name-value pair in class EventAffordance, as otherwise the contentType of an event message remains undescribable. This would be a bug of the specification. What remains to be decided is the value type of the new name-value pair: either a new class à la ExpectedResponse, or a generalization of ExpectedResponse, which is achieved simply by renaming the class. (I do not know which change would be "bigger" - probably the renaming.) A third possibility appears to me inferior: have a new name-value pair "eventContentType", which provides the event contentType as a string, not an object. Inferior for two reasons: (1) There is no way of accommodating further communication metadata, e.g. protocol binding specific metadata; (2) lacking consistency, as the same problem emerging in two types of interaction affordance would be solved in two different ways (I mean the problem how to express communication metadata for a further, non-request message). The name you proposed, ExpectedContentType, would appear to me an unfortunate choice, as the whole idea of wrapping the contentType information in an object is that it might be accompanied by other name-value pairs, which would contradict a name restricted to contentTypes. |
For the record, after looking at the inputs for the implementation report, I see that 3 TDs use the
Also I do agree that this is needed and that we would have something that we cannot describe. |
Please be aware that the Please also consider the requirement from the spec:
Maybe the generic name is not so perfect for an event-based context, but from my point of view it is possible to describe contentType of event messages. |
Oh yes, you are write in reminding me that the response name-value pair is a member of the Form class - my proposal would amount to an inconsistency, as message metadata would in one case be expressed by a form, in the other case by the containing affordance. And it is the form, by definition, which should take care of message metadata and control data. But the criticism remains valid for several reasons. First, the documentation of "response" says: But editing the explanation does not solve the problem. A subscribeevent request can have a response, so the "response" name-value pair obviously describes that response. As it does not make sense to assume that response message and event message have the same communication metadata, the "response" name-value pair cannot describe both, response and event message. I propose to extend the Form class by an additional name-value pair "event", with a value as described in the original posting. PS: An interesting aspect of the new "event" name-value pair is also the possibility to select the content type of event data - done by selecting a form where "event" has the desired content type. |
I see you point. I will discuss this in our next meeting during TPAC next week. I let you know. |
EventAffordance: the contentType of the event message pushed by the Thing cannot be described, as the "op" value of the forms in an EventAffordance must be either "subscribeevent" or "unsubscribeevent". The content type specified by a form thus necessarily refers to a "subscribeevent" or an "unsubscribeevent" request - it cannot describe the event message.
Proposal:
Extension of the information model: class Event has a new name-value pair "event" (in analogy to an ActionAffordance's "response"). The value is an instance of a new class "ExpectedEvent" with the same signature as "ExpectedResponse".
Alternative proposal:
Extension of the information model: class Event has a new name-value pair "event" (in analogy to an ActionAffordance's "response"). The value is an instance of a class "Message". This is not a new class, but the result of renaming class "ExpectedResponse".
To illustrate the problem, consider also example 34, where we have an EventAffordance with a single form, which specifies contentType “text/plain”. As there is no "op" name-value pair, the default value applies, which is “subscribeevent”. As there is no “subscription” name-value pair, the message is without payload, and the contentType “text/plain” thus refers to a "subscribeevent" message without payload. The intention, however, was probably different, as the affordance's "data" name-value pair provides an integer data schema. The "text/plain" seems to be intended for the event message containing an integer number.
The text was updated successfully, but these errors were encountered: