开发者

Handling .NET object-relational impedence mismatch in a special case

I would like to abstract out pure SQL calls in my code as much as possible. I'd like to research nHibernate o开发者_JAVA技巧r 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜