12 June 2008

Repository Pattern

Darryn recently praised the Repository Pattern and I wanted to follow up. I agree with him that this is a very useful pattern to have in your toolbox. I first learned of the pattern in Eric Evan's Domain Driven Design book. The key idea I always remember is that a repository provides transparent interface to persist and retrieve domain objects. This can greatly simplify the code required to implement business functions that interact with numerous domain objects in a service provider object. I usually keep my repositories simple with Save and Finder methods. For example:

public interface ICustomerRepository
{
void Save(Customer);
Customer FindById(int id);

Customer FindByName(string customerName);
...
}

02 June 2008

First Post!

G'day Internet and welcome to robpearson.blogspot.com. The new home of Rob Pearson on the Internet. Since I immigrated to Australia in September 2006, I have been terrible at keeping in touch with friends back in Canada. Therefore I've created this blog to post updates on my life down under on the first Monday of every month. I will also use this blog to post technical content from time to time as I work as a software developer in the real world.

Anyways, I recommend subscribing to my RSS feed and staying tuned for monthly updates.

Rob