I'm planning to implement my next project (asp.net MVC) by using nhibernate as an ORM. Since I do not have experience with nhibernate, I wondering how I should organize dependencies between different projects. I've seen something like this as a recommended approach:
- UI depends on Model, Repositories and NHibernate
- Repositories depend on Model and Nhibernate
----- UI----------------------------- | | | | | | Model NHibernate
The problem is I do not want UI code to interact directly with nhibernate, so I'm thinking of something like this:
- UI depends on Model and Facade
- Facade depends on Model and Nhibernate
Facade, will actually have the repositories as well as encapsulating the nhibernate objects.
Does this sound reasonable? Is there any guideline on the preferred architecture?
Thanx