Tech upgrade is something that happens often. And in most cases these upgrades will happen in phases. One common challenge everyone will encounter during this process is to build a new system with its integrity and also to make it compatible with its dependent legacy systems.
One way to solve this issue is to have an intermediary layer between the new and legacy systems. This will provide us the flexibility to design the new system with its purity and without having the overhead of making it work with legacy systems. The intermediary layer will take care of jelling the gap between two systems. This layer is called as the anti-corruption layer.
Anti-corruption layer can be permanent or temporary. As discussed above when we are building this layer in migration process, mostly it will only be temporary. But there can be cases when we can have this layer permanently.
For example, if the functionality of the system is to bake cake, then all it cares about is the things associated with that. But other aesthetics like, what kind of box it should be packaged in, is it being delivered or picked up etc., should not be added to the functionality of the system. Instead it can be added to anti-corruption layer which will handle the aesthetics of the system without corrupting the actual functionality of the system. In these cases anti-corruption layer will be part of the design and will be permanent.
We can use this in any of the below scenarios: