I've been working with NHibernate and Spring.NET recently on a project and have had to struggle with learning these new technologies of which I had no experience with before. I think I've reached that point where I 'get it' and now I'm able to implement real business value, which is the general purpose of all frameworks.

Taking these frameworks a step further, S#arp Architecture, pronounced 'Sharp' Architecture, makes working with NHibernate, Spring.NET, and ASP.NET MVC even easier! One thing S#arp Architecture provides is a Generic DAO which enables your custom DAO's (Customer, Order, etc.) to remain very light, as they only need provide implementation code when doing more than Save, Update, or Delete. The example below shows a CustomDAO which can Save, Update, SaveOrUpdate, Delete, etc... The only "special" method is the FindByCountry method.

S#arp Architecture Generic DAO in action.

1 public class CustomerDao : GenericDaoWithTypedId<Customer, string>, ICustomerDao 2 { 3 public List<Customer> FindByCountry(string countryName) 4 { 5 ICriteria criteria = Session.CreateCriteria(typeof(Customer)) 6 .Add(Expression.Eq("Country", countryName)); 7 8 return criteria.List<Customer>() as List<Customer>; 9 } 10 }