It seems SnapshotEvent has disappeared and has been replaced by AggregateSnapshot. Why was this change made? It seems AggregateSnapshot would require the aggregate itself to be serialized, which is not always desirable, whereas SnapshotEvent was similar to the memento pattern in that the snapshot event got serialized rather than the aggregate. Unless you’re using binary serialization for snapshots wouldn’t AggregateSnapshot (without mementos) be trickier to manage?
there never was a “SnapshotEvent” class in Axon. In the end a snapshot event is just a domain event. The SnapshotEventStore has an extra method where snapshot events can be reported.
The AggregateSnapshot is just one implementation of a snapshot. And yes, that one requires the Aggregate to be serializable. In most cases, aggregates are perfectly serializable and, in the end, they always contain the state relevant for a snapshot event.
I vaguely remember a SnapshotEvent interface extending DomainEvent. I thinks it's in the documentation as well. Will have to check.
I prefer not to have public getters or setters on my aggregates. The only public methods I have expose behavior rather than state. This means they're generally not prime candidates for contract based serialization.
serialization has nothing to do with the need for getters and setters. XStream doesn’t require them at all. All it needs is it to implement Serializable or have a default constructor.
Some serializers aren’t as flexible as that and require public getters/setters.