Friday, October 05, 2007

Repository Factory

I just got done watching the two screencasts on the Repository Factory by David Hayden.

The Repository Factory is a lightweight O/R Mapper created by the Patterns and Practices team. It was part of the Web Service Factory but the team decided to pull it out and make it separate and usable by all.

Before I go much further I want to say I have never used an O/R Mapper on any application. Even though there are those here where I work who do use them, and they remind how disappointed that Microsoft does not include O/R Mapping in .Net. For a while MS promised us ObjectSpaces to be part of .Net 2.0 but it never made the final cut. Currently ADO.Net Entity framework is due to be released in .Net 3.5. This framework could serve as an O/R Mapper, but from what I here it might be a bit lacking.

Anyways back to the Repository Factory. There were some things i like and others i did not. First the items I found nice.
  1. It can generate all you business entities, and data access classes.
  2. It uses interface when creating repositories allowing for loose coupling.
  3. The mapping of interfaces to concrete classes is handled in the config file.
  4. It handles the mapping of entities to data classes.
Now for what I did not like.
  1. I didn't like the fact I was forced to use stored procedures. I used to be a huge fan of stored procedures, but after noticing how much extra complexity stored procs add to deployments.
  2. Entities same as database table. What if I have an entity that does not map back to one table, but multiple tables.
  3. Lack of complex entities.
  4. Naming
I here NHibernate handles most of what I don't like, but then I am reminded, that Repository Factory is lightweight. Nhibernate is not.

So check out Repository Factory and the screencasts.

Now playing: Nickelback - Animals
via FoxyTunes
Post a Comment