I am designing several applications to work together through Messaging. Each application has its own internal data format.
How can you minimize dependencies when integrating applications that use different data formats?
Therefore, design a Canonical Data Model that is independent from any specific application. Require each application to produce and consume messages in this common format.
The Canonical Data Model provides an additional level of indirection between application's individual data formats. If a new application is added to the integration solution only transformation between the Canonical Data Model has to created, independent from the number of applications that already participate.
The use a Canonical Data Model seems complicated if only a small number of applications participate in the integration solution. However, the solution quickly pays off as the number of applications increases. If we assume that each application sends and receives message to and from each other application, a solution consisting of 2 applications would require only 2 Message Translators if we translate between the applications' data formats directly whereas the Canonical Data Model requires 4 Message Translators. A solution consisting of 3 applications requires 6 Message Translators with either approach. However, a solution consisting of 6 applications requires 30(!) Message Translators without a Canonical Data Model and only 12 Message Translators when using a Canonical Data Model.
... Read the entire pattern in the book Enterprise Integration Patterns
Related patterns:
Format Indicator, Message Channel, Message Router, Introduction to Message Routing, Message Translator, Messaging, Messaging Mapper, Shared Database