5

I have seen this problem a few times and never can come up with a solution i like.

System A
 Sales Order Entity
 order_id
 created
 line_items_count
System B
 Sales Order Entity
 sales_order_id
 created_At
 num_line_items

The problem is, that sales orders are created in System A - for example an e-commerce website. The sales orders need to be exported and stored in another system, for example a warehouse system - System B. They both store the same data but under different field names.

Is there a design pattern or collection of patterns typically used to solve such problem?

I always end up with an associative array containing the mapped fields - but it feels like there must be a better solution.

In the example above, not only sales orders might require this, also customers, products, inventory levels etc - so a generic pattern would be best.

asked May 28, 2015 at 12:11
1
  • How do the systems communicate when you need to map data? Commented Sep 26, 2015 at 7:44

2 Answers 2

2

Though probably not recognised as a design pattern, what you describe would be called a Mapper.
It translates one object into another.
Implementations can be found at AutoMapper.org and at CodeProject.

answered Dec 11, 2015 at 21:33
0

The Web Ontology Language (OWL) implements a description logic with sameAs and other relations between descriptions of entity types as a solution for this problem. 'Description logic' is arguably the design pattern for two-way mappings, as other representations are sub-sets of what a description logic can describe.

If the mapping is single way, then there are many transformation languages in which it can be specified, for example XSLT if the data has an XML representation.

answered May 28, 2015 at 12:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.