What is the preferred approach to evolving the domain given a system
that has gone live and the domain event for the various aggregates
have been stored in the event sourcing repository. I will try and
illustrate this with as example.
I start with a domain that has two entities a Account and an Account
Type. The Accout Type may be Credit Card, Debit, Cheque etc. After the
system has gone live a large number of accounts have be created of the
various types. So the event store would look like
AccountTypeAddedEvent (Credit Card)
AccountTypeAdded (Debit)
AccountTypeAdded (Cheque)
AccountAddedEvent (type = Credit Card)
AccountAddedEvent (type = Debit)
AccountAddedEvent (type = Debit)
AccountAddedEvent (type = Debit)
AccountAddedEvent (type = Cheque)
After speaking to the business analysts and users we determine that
the domain needs to change from:
Account has an Account Type
to
CreditAccount, DebitAccount and ChequeAccount extend from Account
I am guessing that it is a matter of replaying the domain events from
the repository by associating then with the new aggreates or are there
other alternatives? I think that the domain could evolve substantially
after the system has gone live and the evolution could be quite
complex. Does axon support these situtation or I going down the wrong
here?