We're embarking on a new middle tier service that will allow internal client systems to create and update and query records in some underlying data stores. The service will aggregate as many as 3 seperate underlying datastores. For the purposes of this question assume:
Data store #1: Proprietary XML Database.
Data store #2: Off the shelf relational Database.
Data store #3: Flat file store (files stored as binary).
The clients will not know (nor care) which datastore they are querying/udpating. The new service will make that decision. My question is this: Should my API expose XML or objects? E.g. The new API will have an add method. Assuming that our system is a car storage system, then the add method of the API may look like this:
AddNewCar( CarObject car )
or, it could look like this:
AddNewCar( string carXml )
Now, even though the 2nd method is weakly typed at entry, the XML will immediately be validated against schema as a minimum.
The new service is going to be written in C# (not decided yet on which version, but probably 3/3.5 with WCF). Clients of the API could be C#/VBA/VB.Net/C++/Java).
Any more details please let me know. Thanks
Update: Note that the API will also be publishing XML over a message bus. E.g. when a new car is added the car XML will be published so that anyone who is interested in new cars will be notified.