core-java
core-java copied to clipboard
Substitute `MessageEnvelope`s with interfaces with default and static methods
Currently, many messages in the framework have associated Envelope
types, e.g. CommandEnvelope
, EventEnvelope
. This is semantic duplication. We should use interfaces with (is)
option instead.
It's a nice issue, and I would like to get rid of envelopes some day. But EventMessage
!= Event
.
We can probably, re-name Event
to something like EventObject
, and have the Event
interface, which EventObject
message implements. Then Event
could probably have all the things that now EventEnvelope
exposes.
@armiol, what's your view on this matter. It's a significant change, which is nice, but should be done after v1.0.0 is out and other important matters are addressed. It's a server-side internal thing. We can polish it when time permits.