From Gitter earlier:
Sascha-Oliver Prolic
@fritz-gerneth you should be able to decide one day to integrate rabbitmq with a few simple steps, you shouldn't need to rewrite big parts of your application. Also you shouldn't know if the message is sent over the wire or not. Your stuff is supposed to just work, no matter what infrastructure is on the other side. Allowing objects in payload for most of the time (and sometimes not) only makes much bigger problems on the other end. I understand that you know your infrastructure and that you don't send messages somewhere else, but your limited situation is no reason for me to make the thing much more complex. Also how would you store events payload in the event store? This at least is a common problem with objects already, even if all your consumers would be PHP.
[...]
Fritz Gerneth
but I think the correct behavor would be that the default factories / converter throw the exception, not the message itself. that's what happening most of the time anway already. aka it should not the message to care about that but the infrastructure level. the default one does not allow objects, that's probably easier for everyone
Use-Case:
- Event contains a composable VO (tree like structure with many different implementations of a shared composable interface)
- Currently needs static mapping from array to object structure, very closed for extension, very open for modification, breaks modular approach and extensibility
- Handle built-in types better (e.g. date)
My stance on this:
- Messages itself should allow objects as payload
- Validation should only be done on the infrastructure level
-- MessageConverter / MessageFactgory implementations are responsible for this
-- For the event store, the event store strategy is responsible for this
- Default behvaior should still be to throw exceptions
- This allows custom
MessageConverters / .. capable of handling objects in the payload
Alternatives:
- Re-implement command / event / query message types
- Fix inconsistent behavior that messages can be created with objects in payload but fail validation when metadata is updated (which triggers payload validation, payload validation should be checked on set)
From Gitter earlier:
Use-Case:
My stance on this:
--
MessageConverter/MessageFactgoryimplementations are responsible for this-- For the event store, the event store strategy is responsible for this
MessageConverters / .. capable of handling objects in the payloadAlternatives: