I am implementing a college project to test the performance of the Entity Framework 4.0 compared to NHibernate (latest version). I am building a simple transaction processing system to do this testing. My entities will be things like Customer, Account, Order, Product.
I want to create two separate DALs; the first DAL will be the EntityFramework while the second will be NHibernate. I will then create a business logic layer (BLL) which references either one DAL or the other and use this to test. The BLL will include methods like 'insertNewOrder()', 'amendExistingOrder()' etc. I want my BLL to be framework independent so I can easily switch between each DAL.
To enable this, I propose to implement an Interface 'IContext' which will be implemented by each DAL. The 'IContext' will include my 'get()' methods for each entity and also a 'Save()' method. Each DAL will then implement these methods in their own specific way. The 'get()' methods will return an IObjectSet, rather than an ObjectSet.
I will use a T4 template to create POCO entities from my EDM and move these to a separate project. Each DAL can then reference the same set of POCO entities.
My BLL will then create an instance of the IContext interface and call methods on that interface, rather than creating a specific context (ObjectContext or ISession).
Does this sound like a feasible solution? Any article I find on this subject includes the use of repositories, a pattern which I don't fully understand and would like to avoid having to implement if possible. My focus is on testing each platform rather than building an application which is architecturally correct. See here for example:
I have partially based this approach on a chapter from "Programming Entity Framework 2nd Edition" by Julia Lerman. I am new to both NH and the EF (particularly NH), so any advice or recommendations would be appreciated. Thanks.