Let’s kill the full-stack developer
By Daniel Ávalos
Let me start by asking a question: What does being a full-stack developer mean to you? I’m sure some people…
Read MoreIn the past, I have had the opportunity to be part of projects with robust and complex systems that need to communicate with each other. But due to the lack of homogeneity of their technologies, it has become a headache for the development teams involved. This is where this pattern helps to overcome many of these obstacles. In this post, I want to share a quick and concise explanation about the anti-corruption layer pattern.
The anti-corruption layer pattern implements a facade or adapter between different systems with different semantics. The main purpose is to translate the request from one system to another, trying to reduce dependencies and limitations.
“Create an isolating layer to provide clients with functionality in terms of their own domain model. The layer talks to the other system through its existing interface, requiring little or no modification to the other system. Internally the layer translates in both directions as necessary between the two models.”
— “Domain-Driven Design: Tackling Complexity in the Heart of Software” by Eric Evans
Context
Several companies dedicate their efforts to solving specific problems under specific mechanisms, technologies and architectures, forgetting a potential unification or communication of those systems in the future.
Many of these scenarios are present when trying to interface a new or recent system with legacy components, causing compatibility issues. In these cases, the priority must be to respect the restrictions of the system and not include bad practices in our code in order to force communication between those involved.
An ally to solve this problem is to implement an anti-corruption layer, which serves as an adapter and translator between the requests that the systems or subsystems involved make.
When to use?
If you do not have homogeneous systems, you can use this pattern in order to avoid mixing protocols and communication mechanisms between different architectures and subsystems.
Advantages
Disadvantages
In conclusion, I would recommend implementing this pattern under the following premises:
Let me start by asking a question: What does being a full-stack developer mean to you? I’m sure some people…
Read MoreAs developers, we spend thousands of hours seeing the world through the lens of code in a digital world. But…
Read More