Refactoring Aggregates in Axon


Could you please write an article about refactoring aggregates .
Small changes to an aggregates can be accomodated through Upcasters but what if we want to make large changes to existing aggregates.

for eg Changing the name of the aggregate and making the aggregate as subclass of another aggregate root, pulling out common fields in the super class.

Thank you


you don’t need upcasters when making small changes to aggregates. Upcasters are only necessary when the serialized form of Events changes. Structural changes to an aggregate do not affect your application if you’re using event sourcing.

When changing the name of an aggregate, you may need to perform an update query on your event store tables to update the aggregateType field. However, Axon 3 doesn’t use that column anymore. It’s just there for debugging and analysis purposes.