Last night I sat down and played with how I could abstract my linq so I could use any provider I wanted. This has been a common request on some of the forums I've been reading and so I figured I would give it a shot. Now this post is just a teaser, I am going to use this topic as my first screencast so expect that to show up here sometime this weekend.
Goals for my experiment (or what I'll be doing in my screencast):
-
Allow multiple diffrent providers (save Linq to XML due to casting constraints in Linq to XML) to expose the same objects up to a single business class
-
Make a factory where by settings could be uses to pass the correct provider to its caller such that the caller is provider ignorant about the Linq it is using.
-
Validate that there are no obvious performance hits caused by this (Most importantly tha linq to SQL doesn't do something "wacky" that caues it to speu crazy SQL rather than sain SQL).
I am happy to say I achived all of these goals, and now you'll just have to wait to see how :-)..