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 }
Comments
July 10. 2008 15:02
I've got a new build available, version 0.7, which you'll want to take a look at. It's much simpler than the previous version and/but does not have Spring.NET integrated any longer. This has resulted in much cleaner code with a smaller footprint and less maintenance.
Billy McCafferty
July 10. 2008 15:25
Yeah I saw that. I was a little surprised honestly when I read that Spring was dropped. I've taken a look at the latest build and it does seem less heavy. I'll see if I can roll up a site here with it this weekend at GiveCamp.
Ryan Montgomery
July 1. 2009 16:54
Just because we've grown up and our stage looks a bit different now, we haven't outgrown the tendency to shine when we're appreciated.
vajinismus
Home
© Rapidparts, Inc 2008 | 2950 Walkent Ct. NW, Grand Rapids, MI 49544 | Phone 616.647.2500 | info@rpionline.com