--- url: "http://www.enterpriseintegrationpatterns.com/MessagingMapper.html" titulek: "Messaging Mapper - Enterprise Integration Patterns" h1: "" popis: "How do you move data between domain objects and the messaging infrastructure while keeping the two independent of each other?" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-15 15:34:36" znaku: 5643 slov: 531 kodovani: "utf-8" sha256: "fdd610e2031601d9960698815ed18685d6d54450db5d4a858038258fe3e71a21" --- | | Messaging Mapper[Messaging Patterns](index.html) » [Messaging Endpoints](MessagingEndpointsIntro.html) | [Contents](toc.html)[⇐ Prev](MessagingGateway.html)[Next ⇒](TransactionalClient.html) | | --- | --- | --- | When integrating applications using messaging, the data inside a message is often derived from domain objects inside the integrated applications. If we use a [*Document Message*](DocumentMessage.html), the message itself may directly represent one or domain objects. If we use a [*Command Message*](CommandMessage.html), some of the data fields associated with the command are likely to be extracted from domain objects as well. There are some distinct differences between messages and objects. For example, most objects rely on associations in the form of object references and inheritance relationships. Many messaging infrastructures do not support these concepts because they have to be able to communicate with a range of applications, some of which may not be object-oriented at all. How do you move data between domain objects and the messaging infrastructure while keeping the two independent of each other? Create a separate *Messaging Mapper* that contains the mapping logic between the messaging infrastructure and the domain objects. Neither the objects nor the infrastructure have knowledge of the *Messaging Mapper*'s existence. The *Messaging Mapper* accesses one or more domain objects and converts them into a message as required by the messaging channel. It also performs the opposite function, creating or updating domain objects based on incoming messages. Since the *Messaging Mapper* is implemented as a separate class that references the domain object(s) and the messaging layer, neither layer is aware of the other. The layers don't even know about the *Messaging Mapper*. The *Messaging Mapper* is a specialization of the *Mapper* pattern defined in [[EAA](http://www.amazon.com/exec/obidos/ASIN/0321127420/enterpriseint-20)]. It shares some analogies with the *Data Mapper* defined in the same book. Anyone who has worked on O-R (Object-Relational) Mapping strategies will understand the complexities of mapping data between layers that use different paradigms. The issues inherent in the *Messaging Mapper* are similarly complex and a detailed discussion of all possible aspects is beyond the scope of this book. Many of the Data Source Architectural Patterns in [[EAA](http://www.amazon.com/exec/obidos/ASIN/0321127420/enterpriseint-20)] make a good read for anyone concerned with creating a *Messaging Mapper* layer. ... Read the entire pattern in the book [Enterprise Integration Patterns](/books1.html) **Related patterns:** [*Aggregator*](Aggregator.html), [*Canonical Data Model*](CanonicalDataModel.html), [*Command Message*](CommandMessage.html), [*Document Message*](DocumentMessage.html), [*Message Router*](MessageRouter.html), [*Message Translator*](MessageTranslator.html) --- ## Integration Pattern Language [Message Construct.](MessageConstructionIntro.html) [Message](Message.html) [Command Message](CommandMessage.html) [Document Message](DocumentMessage.html) [Event Message](EventMessage.html) [Request-Reply](RequestReply.html) [Return Address](ReturnAddress.html) [Correlation Identifier](CorrelationIdentifier.html) [Message Sequence](MessageSequence.html) [Message Expiration](MessageExpiration.html) [Format Indicator](FormatIndicator.html) [Message Routing](MessageRoutingIntro.html) [Pipes-and-Filters](PipesAndFilters.html) [Message Router](MessageRouter.html) [Content-based Router](ContentBasedRouter.html) [Message Filter](Filter.html) [Dynamic Router](DynamicRouter.html) [Recipient List](RecipientList.html) [Splitter](Sequencer.html) [Aggregator](Aggregator.html) [Resequencer](Resequencer.html) [Composed Msg. Processor](DistributionAggregate.html) [Scatter-Gather](BroadcastAggregate.html) [Routing Slip](RoutingTable.html) [Process Manager](ProcessManager.html) [Message Broker](MessageBroker.html) [Message Transformation](MessageTransformationIntro.html) [Message Translator](MessageTranslator.html) [Envelope Wrapper](EnvelopeWrapper.html) [Content Enricher](DataEnricher.html) [Content Filter](ContentFilter.html) [Claim Check](StoreInLibrary.html) [Normalizer](Normalizer.html) [Canonical Data Model](CanonicalDataModel.html) [Messaging Endpoints](MessagingEndpointsIntro.html) [Message Endpoint](MessageEndpoint.html) [Messaging Gateway](MessagingGateway.html) [Messaging Mapper](MessagingMapper.html) [Transactional Client](TransactionalClient.html) [Polling Consumer](PollingConsumer.html) [Event-driven Consumer](EventDrivenConsumer.html) [Competing Consumers](CompetingConsumers.html) [Message Dispatcher](MessageDispatcher.html) [Selective Consumer](MessageSelector.html) [Durable Subscriber](DurableSubscription.html) [Idempotent Receiver](IdempotentReceiver.html) [Service Activator](MessagingAdapter.html) [Messaging Channels](MessagingChannelsIntro.html) [Message Channel](MessageChannel.html) [Point-to-Point Channel](PointToPointChannel.html) [Publish-Subscr. Channel](PublishSubscribeChannel.html) [Datatype Channel](DatatypeChannel.html) [Invalid Message Channel](InvalidMessageChannel.html) [Dead Letter Channel](DeadLetterChannel.html) [Guaranteed Delivery](GuaranteedMessaging.html) [Channel Adapter](ChannelAdapter.html) [Messaging Bridge](MessagingBridge.html) [Message Bus](MessageBus.html) [Systems Mgmt.](SystemManagementIntro.html) [Control Bus](ControlBus.html) [Detour](Detour.html) [Wire Tap](WireTap.html) [Message History](MessageHistory.html) [Message Store](MessageStore.html) [Smart Proxy](SmartProxy.html) [Test Message](TestMessage.html) [Channel Purger](ChannelPurger.html)