[axonframework] Pattern for calling legacy systems

Hi Michael,

I personally always reference users to have an anti corruption layer between your ‘MVP’ and the legacy systems.
What this means in short, as that your MVP can keep it’s own API (the commands, events and queries) internally and will not inherit any of the legacy systems their API’s in the core.

Thus, if you’d for example need to query customer records, your MVP would publish a Query Message ‘to spoof’ as if the legacy system can actually handle this message.
You would instead have another service (the anti corruption layer) which handles the query message.
This service would be aware of the legacy system API, but note this is the only spot where this API is known.

A similar exercise could/should be performed for any operation/request you have from within your MVP to the outside world.

That’s my two cents.