So,
I currently am working on a project, in which two different datasources will be updated.
The business objects have similar structures, but not exactly the same.
What I have currently planned on doing, is using a provider interface, so I have have a handler class to push to both databases.
As the 2nd object is from an external API, I thought that the best thing to do, is push my custom object through, and in the API's provider, to map things over manually, so the other developer implementing the forms etc for this would be able to do all this seemlessly.
I suppose I am always going to have to do the mapping over at some point, but I was wondering if anyone had a nicer way that just doing it in the implemented methods - below is skeleton on what I was currently thinking.. any ideas?
IBusinessObject1PushProvider
{
Create();
}
DSOneBusinessObject1Pusher : IBusinessObject1PushProvider
{
Create()
{
// move custom object into our database
}
}
DSTwoBusinessObject1Pusher : IBusinessObject1PushProvider
{
Create()
{
APIObj1 ob1 = new APIObj1();
ob1.Name = obPassedThrough.FirstName + obPassedThrough.LastName;
// move ob1 to the webservice having had the datamassaged.
}
}