Background
I'm sketching on an application that needs to perform something like this
database a >--| |--> fileformat 1
database b >--+--> custom application >--+--> fileformat 2
... | | ...
database n >--| |--> fileformat n
The databases in question are all of the same type but with different tables and structure. The objects that are to be loaded are all products of some type. The files have similar structure but not necessarily the same, some are xml, some are csv etc.
The custom application is here to ensure a consistent interface for manipulating the objects retrieved from the relational data. It is a simple web application with a few options on each product and a paginated display of the products. It adds additional data to each record that is persisted through the means of an ORM.
Only one database will be active in each instance of the application, however many fileformats can be active. The writing of these files are simultaneous.
Question
I've been struggling with finding the best approach for designing the conversion steps.
Is there a pattern that somehow manages to combine the different schemas into one single Model? There is the assumption here that only the fields that are present in all of the databases are supposed to end up in the model.
And what about the reverse? When the product objects are to be written to file?
I've looked at different patterns such as the Strategy pattern, but i'm still not having that moment where all the bits and pieces seem to fall into place.
For what it's worth the application itself will most likely be written in PHP.