chore(refactor): prefer interfaces over concrete classes #457
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change modifies the protocol binding interfaces such as
Binding
,Serializer
and thecloneWith()
methods to use theCloudEventV1
interface instead of the implementation classCloudEvent
. This should make extending the interfaces simpler as using interfaces decouples Specification Extensions for relying on the concreteCloudEvent
class. This work has grown out of efforts around the implementation of a second transport interface, Kafka.See: #455
In addition, this PR includes:
Message
interface, defaulting tostring
message/http
modules. Now, instead of exporting the entire implementation, only theHTTP
binding implementation is exportedCloudEvent.cloneWith()
method has been added which the instance methods now useI'm pretty sure all of this is fully backwards compatible as there were no changes required for the tests.
I will hold on #455 until this has landed, so that I can pull in these changes and keep 455 small-ish.
Signed-off-by: Lance Ball [email protected]