Friday, March 14, 2008

Repository Library - Initial Feedback Release

I am releasing my own repository library, mainly for feedback at this point, however it should be somewhat usable, proceed at your own risk (I have yet to build tests or use in a real app), under the ISC license (BSD).

You can pick up the source code (includes dependencies) here.

 

The library, while simplistic in nature, allows for the simplification in usability by making use of extension methods.  The following interfaces are available:

 

IRepositoryContext : This interface is what replaces the IxxxxRepository interfaces or IRepository<xxxx> of the typical Repository Pattern.  The Context Interface allows reference of types as such: context.Xxxxx().Find/Save/etc, all wrapped (optionally) within a Transaction when used with the NHibernate Repository Provider.

IRepository/IQueryRepository : This is the interface (one of) returned via the context.Xxxxx() call.  The generic types are <ModelObject, KeyType> for IRepository and <ModelObject, KeyType, QueryEnumType> for IQueryRepository.

IBuilderRepository : This interface allows passthrough of query objects which may be specific to the underlying repository provider (I plan to use this to implement a generic query generation UI system, using NHibernate specific features, etc...)

 

In additional to these Interfaces, located in the Acqusys.Repository assembly, a provider for NHibernate is provided with the implementations, as well as a small set of example projects.

 

While this blog posting doesn't give the full attention this project deserves, and with all the debate on the ALT.NET mailing list, I figured the best bet would be to push this out there for whoever wants to take a look and possibly provide feedback.

Time for my own implementation of this repository!

No comments: