16 Kasım 2014 Pazar

Domain Driven Design - Anti Corruption Layer - Translation Layer Gibi Düşünülebilir

Anti Corruption Layer Nedir?
Anti Corruption Layer, Domain Driven Design ile karşımıza çıkan bir kavram. Bir çok açıklaması mevcut. 

1. Uygulamalar Arasındaki Katman Olabilir
Uygulamalar arasında olabilir. Açıklaması şöyle
When one system needs to talk to another system and if these 2 systems are not compatible, you can use an intermediate layer which is capable of translating first systems communication to the protocol which is used by the second system and vice versa, this intermediate system is called as an Anti Corruption Layer since that layer helps to avoid the data corruption which would have happened otherwise. This is not a new concept and the traditionally, Enterprise Service Bus (ESB) has been used as this intermediate layer.
Şeklen şöyle

2. Uygulama ve Veri tabanı arasında olabilir
Açıklaması şöyle.
If your application needs to deal with a database or another application whose model is undesirable or inapplicable to the model you want within your own application, use an Anticorruption Layer to translate to/from that model and yours.
3. Bounded Context' ler Arasındaki Katman Olabilir
Bir açıklaması şöyle. İki tane Bounded Context arasına yerleştirilir. Böylece birbirlerinden yalıtılmış hale gelirler. 
Anticorruption Layer is a means of linking two Bounded Contexts. Create an isolation 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.

The public interface of the ACL usually appears as a set of services. One way of organizing the design of the ACL is as a combination of facades, adapters, and translators, along with the communication and transport mechanisms usually needed to talk between systems.
4. Microservice ve Legacy Sistem Arasındaki Katman Olabilir
Açıklaması şöyle
A legacy system may have unmaintainable code and an overall poor design, but we still rely on the data that comes from this module. An anti-corruption layer provides the façade, or bridge, between new microservices architecture and legacy architecture. Therefore, it allows us to stay away from manipulating legacy code and focus on feature development. 
Şeklen şöyle


Anti Corruption Layer Ne Değildir
Software ICD mesajlarını kendi yapımıza çeviren arayüz katmanına Anti Corruption Layer denilemez. Çünkü bu  çevrim işlevini yapacak kod parçası zaten yazılacaktır.

Hiç yorum yok:

Yorum Gönder