Transformation Factory

This is an implementation pattern to be used inside a MessageTranslator. The problem is that a MessageTranslator may receive N different message types that need to be translated into M other formats.

So, the idea that this implements is to have different translators (strategies in the StrategyPattern) that each handle one message output. When a message is received it is first translated into a CanonicalMessageDataFormat. It then is passed off to the appropriate strategy for conversion into the final target format.

There is a tiny bit of magic here in knowing which end-format to translate to, but a simple set of rules (if coming in on this format translate to that, or if coming from this source translate to this other) can normally solve this. The tricky bit is to make the choice of translator configurable and to make the set of translators extensible.

--KyleBrown (originally mined by MartinFowler)



EditText of this page (last edited February 28, 2011) or FindPage with title or text search