I'm trying to decide on the best strategy for accessing the database. I understand that this is a generic question and there's no a single good answer, but I will provide some guidelines on what I'm looking for. The last year we have been using our own persistence framework, that although limited has server as well. However it needs some major improvements and I'm wondering if I should go that way or use one of the existing frameworks. The criteria that I'm looking for, in order of importance are:
Client code should work with clean objects, width no database knowledge. When using our custom framework the client code looks like: SessionManager session = new SessionManager(); Order order = session.CreateEntity(); order.Date = DateTime.Now; // Set other properties OrderDetail detail = order.AddOrderDetail(); detail.Product = product; // Other properties
// Commit all changes now session.Commit();
- Should as simple as possible and not flexible. We need a single way to do most things.
- Should have good support for object-oriented programming. Should handle one-to-many and many-to-many relations, should handle inheritance, support for lazy loading.
- Configuration is preferred to be XML based.
With my current knowledge I see this options:
- Improve our current framework - Problem is that it needs a good deal of effort
- ADO.NET Entity Framework - Don't have a good understanding, but seems to complicated and has bad reviews.
- LINQ to SQL - Does not have good handling of object-oriented practices
- nHibernate - Seems a good option, but some users report too many archaic errors.
- SubSonic - From a short introduction, it seems too flexible. I do not want that.
What will you suggest?
Thank you