Repository Pattern – Part One

When I build repositories in my domain, I often find my find myself in a dilemma. Should I create generic, boilerplate code for reuse, or should I be explicit? How should I design my repositories in a way that it is as technology agnostic as possible? I don’t want to care about DAL while I am designing my repositories.

There is no “One” design; every project is different. It is silly to even dream up one… I will create series of posts which will be an exercise to compare and discuss each implementation.

Objective

Build a service layer and repository implementations to service Customer entities in a console application. The application uses DDD (Domain Driven Design) in its architecture.

Solution

I will use different ORMs and patterns to implement the repository pattern. I will do this iteratively and improve implementation as I go. I’ll try to use various ORMs (Linq to Sql, EF, NHibernate),  persistence stores (MongoDB, SQL Server), design patterns and techniques (Specification, Services, IoC) along the way.

Let’s see where we’ll end up…

Resources

Advertisement
Leave a comment

1 Comment

  1. Repository Pattern – Part Four « Altug Sahin's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.