MVC Storefront, Part 2: Repository Pattern

Posted in Frameworks, Companies, Development on May 28, 2008

Get Microsoft Silverlight

In this installment, I walk through our Repository implementation and write out the first main set of unit tests. I also  structure up the initial service layer methods and interfaces.

Getting Off The Ground
Finally! I get to code something! Our first set of requirements are pretty simple - which is the way we want em since we're being Agile:

  1. Users can brows products by Category and SubCategory
  2. Clicking on a Product in the category list shows a Product detail
  3. The product must display culture-specific pricing/descriptions as well as any discount information
  4. Each product can have 0 to many reviews.

I take a pretty good chunk out of the requirements in this session - working on the main setup of the Service layer as well as the Catalog Repository.

I also show you how you can work without a database (and keep working without one) as you test up and build your application from nothing. Ideally when working with TDD, you want to be sure that the your tests which require data are as isolated as possible. In other words - you don't want bad data to fail your tests.

by Rob Conery

Watch Video on External Site Watch Video on External Site Watch Video

Tags: Frameworks, Microsoft, ASP.NET, C#, .NET Framework, ASP.NET MVC, MVC Storefront