tags:

views:

27

answers:

1

I would like to abstract out pure SQL calls in my code as much as possible. I'd like to research nHibernate or LINQ-to-SQL, but I'm wondering how the scenario I'm dealing with affects my decisions.

The database I'm reading from is a legacy database, and I can't change its schema or anything - I'm stuck with what's there. The bigger problem comes in with writing back to it - it has to call a business layer via XML. I can't write directly to the database at all. So though I'm using SQL to pull data out of it, I'm using XML to hit a web service to write back to it.

What sort of technologies or engineering approaches can I use to provide some sort of abstraction and/or make my life easier, if any?

+2  A: 

You could always use whatever ORM (LINQ to SQL, Entity Framework, nHibernate, etc.) for reading the data and then build a Facade layer on top of a combination of the web services (for writing) and the objects (for reading).

That will abstract the difference away from the people using your facade layer.

Justin Niessner