Open slifty opened 3 years ago
It could be the responsibility of the appliance author to update to use the latest Payload / Payload array as new versions of the base-class package comes out. The issue is that it's hard to debug a topology where some appliances are generating "bad" payloads, and a given appliance might work in one topology and not in another depending on whether a given stream connects appliances with invalid payload / payloadarray versions.
I think it matters enough to at least document / come to a decision.
We could have the countertop re-package into a common Payload type. In a away this already happens because we use AvroPayload to serialize -- so this is more meta / what happens if Payload evolves in a way that AvroPayload is not able to serialize certain types of payload.
(Also of note: IAppliance
and AbstractAppliance
face a similar version of this situation with PayloadArray
since Appliances are expected to return a PayloadArray and the versions may differ.)
This has an added benefit that Appliances wouldn't need to add Payload / PayloadArray as a package dependency.
The negative is that if features are removed from Payload or PayloadArray then a given appliance relying on that injection might break between major releases. Even so, that's better than the current state (appliances potentially breaking a topology on minor releases because they no longer generate Payloads with the latest features)
Right now I'm leaning towards:
Updating the IAppliance
interface to return arrays of Payloads
instead of a PayloadArray
Updating the IAppliance
interface (and AbstractAppliance
) to accept injected base classes.
Discussion
What do you want to talk about?
We have a
@tvkitchen/base-classes
package which defines some common classes for use across the project.However,
Payload
objects are generated by appliances. This means the countertop doesn't get to determine the exact type being passed unless it were to re-package payloads in new objects.This prompts a few questions:
Does this matter?
If so, what should be done?