Architect Serverless Applications with Anticorruption Layers
Prevention is better than cure!
This popular proverb is believed to be from the 1500s.
It is easier to stop a problem from happening than to repair the damage after it has happened.
The anti-corruption layer concept as a preventive and protective measure has existed for centuries in medicine, manufacturing, labs, and other industries.
In software, the anticorruption layer (ACL) gained attention as a pattern after Eric Evans' seminal book Domain-Driven Design: Tackling Complexity in the Heart of Software (Addison-Wesley Professional) was published.
In software, ACL also serves the same purpose: prevention and protection.
Team X was autonomous; guarded its bounded context — Orders.
Engineers built APIs to operate on order data and published (domain) events on an event broker. They used a third-party order management system (OMS) as an order store and interacted with a few internal systems.
For unknown reasons, the team didn’t spend time building a sophisticated domain model. Instead, they mirrored part of the OMS. Their APIs behaved like proxies with business logic scattered everywhere.