Anticorruption Layer — An effective Shield

  1. Translate model
  2. Protection against failure
  3. Monitoring
  4. Improve our integration testing

An example

Imagine that we are developing a banking related application. And we need to deal with credit card appended to an account.

Translating models

Here is our model. We have a basic credit card information and we could validate it with some well known algorithm.

Ready for failures

What happens to our application if the credit card server falls? Would we see an error 500 on our application? Maybe a warning page are more confortable to our users or hide this part of the page information and show the rest or we could use a “cirtuit breaker” and provide a cached response.

Improving our service

The existence of this abstraction layer allows us to decorate it andadd more features this in order to increase the defenses of our system. Probably we need to log all transactions in order to have some audit. Probably, we could measure time response or response code and send all telemetry to a ELK Stack.

Integration testing

Conclusion

In conclusión. With a ACL we will grant:

  1. Translate information
  2. Protect from other subsystem failures
  3. Log and monitorization relationships
  4. Good integration testing

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store