I develop an application that allows to access two different ERP systems. I want to abstract away some differences, such that I can search the same entity in both systems and represent a list that contains entities of both (e.g. a list of invoices). I'm thinking about how to architect this.
One approach is using the ActiveRecords pattern, have a Document
class that extends from ObjectModel
and then create two subclasses that each contain the database field to object property mapping. I feel it is cumbersome, because these object then represent a single instance of a Document
, and still need to handle queries that result in a collection of documents.
I never touched doctrine2, but as I'm reading about Active Record vs Data Mapper pattern, it seems that it could bring a solution to my problem. Therefore my question:
Is it possible to have one object (here Document
), and link two data mapper configurations to it, one for each data source ?