Repository Pattern, etc

Coordinator
Jun 5, 2008 at 1:33 PM
So, I haven't seen much discussion about the recent round of offerings posted, but I wanted to add a little more context to my recommendations on the repositories.

This article:  http://www.sidarok.com/web/blog/content/2008/05/02/10-tips-to-improve-your-linq-to-sql-application-performance.html  talks about how to improve performance.  Most of the items are keyed around using largely 'standard' queries for your domain models, which makes sense.  For the most part, your models should be getting the same kinds of data over and over again.  I would submit that an implementation of a LinqRepository (or series of them) would rely on doing things like compiling the queries and using appropriate LoadWith options, and each repository would likely map to a different datacontext (along the lines of the Domain Aggregates, most likely). 

For a little more background on the repository pattern, check out this guy's post:  http://www.codeproject.com/KB/architecture/linqrepository.aspx which explains some of the benefits and how to put one together in Linq that still lets you decouple your model from your infrastructure.  It's similar to the one I did, with a handful of differences.  I just found this today.

Paul