Question about Event Sourced Aggregates in documentation

Hi,

I’m trying to make use of the example found within the chapter http://www.axonframework.org/docs/2.0/single.html#d4e750, and I’m currently depending on axon-core 2.0.3.

Questions:

  1. When extending AbstractEventSourcedAggregateRoot it has more/changed methods to implement (getChildEntities, handle, getIdentifier) then shown in the example. I assume the example isn’t updated?
  2. The signature of handle method has changed from taking a DomainEvent into taking a DomainEventMessage as input. Assume example isn’t updated?
  3. The following code snippet from handle method:

// make sure to always initialize the aggregate identifier
this.aggregateIdentifier = ((MyAggregateCreatedEvent) this.getPayload()).getMyIdentifier();

should maybe be updated to:

// make sure to always initialize the aggregate identifier
this.aggregateIdentifier = ((MyAggregateCreatedEvent) dem.getPayload()).getMyIdentifier(); // where dem is the variable name of the DomainEventMessage taken as input

  1. Could you also provide code for how the MyAggregateCreatedEvent looks like to make the example complete?

Thanks in advance!

Regards,
Viggo

Hi Viggo,

you’re right. The documentation is incorrect at this point.
I have created issue AXON-163 to track the suggested improvements.

Kind regards,

Allard