Skip to content
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

Give serializers flexibility to map based on event type #444

Open
aidan-casey opened this issue Oct 14, 2023 · 0 comments
Open

Give serializers flexibility to map based on event type #444

aidan-casey opened this issue Oct 14, 2023 · 0 comments

Comments

@aidan-casey
Copy link

Hey there!

The current serializer interface requires that the implementation keep track of the event class when serializing.

For example:

{
	"class": "MyOrg\\CRM\\Contact\\ContactWasCreated",
	"payload": {...}
}

It is traditionally better practice to remove references to the class in the event store and have this mapped during deserialization. Handling serialization this way also ensures some ability to work with these events across multiple systems (and languages).

However, we would have to introduce some breaking changes to facilitate this.

  • The serializer now needs to be conscious of the event type.
  • The metadata serializer may need to become a separate interface.
  • We need to introduce an additional interface for event-type mapping.

I am happy to start looking into implementing these features, but I wanted to probe whether it would be something that you would accept, given the breaking changes it introduces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant