Repository Pattern, etc

Jun 5, 2008 at 12: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:  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: 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.