POJO Class Bindings and Factory Classes
Anypoint DataMapper allows you to map an interface or abstract class as a POJO. Binding, in this case, refers to linking your POJO (which can be an interface or abstract class) to a concrete class. Thus, when instantiating your POJO, Mule uses the concrete class you specified.
DataMapper will continue to be fully supported in all current and future versions of Mule ESB 3.x, however it will be removed in Mule 4.0 in favour of the Transform Message component (based on DataWeave code). We recommend that if you wish to take advantage of the new capabilities of DataWeave or if you start new projects, upgrade now.
A migration tool is now included in Studio, which assists in converting a DataMapper map to DataWeave. Right click on a DataMapper, select Migrate to DataWeave, and follow the instructions.
If you don’t see DataMapper on your palette, you can enable it by going to Preferences → Anypoint Studio → Palette Profiles and ticking the checkbox Show deprecated Mule Components and Attributes.
Factory classes allow you to delegate object construction to another class. In this case, your factory class must have a static method called
create, that returns the object you want to instantiate.
To specify bindings and factories, open the Properties dialog by clicking the cog icon (highlighted below) in the Output mapping pane of the DataMapper view.
Click Binding Definition or Factory Definition to add, remove or edit binding or factory properties.
Uncheck the Cache Data in Memory checkbox if you want DataMapper to cache process data to disk instead of in memory.
Click OK to save your changes.