I have a Visual Studio solution with three projects:
- MyWebSite (A)
- BusinessModel (B)
- Durability (C)
Persistence , project C , is NHibernate dependent and contains all the repository interfaces, Hibernate implementations of these repositories, and classes that map to database tables.
BusinessModel , project B , is dependent on C and contains all service classes and classes that represent business domain entities. These services use repositories to retrieve data, and then translate that data into business surface views into their interfaces.
MyWebSite , project A , is dependent on A and contains all MVC classes / files. Here MVC controllers use the class of service from B to perform any business logic functions. At this level, there is no knowledge that Project B uses the project C repositories to carry out its operations.
In an ideal world, I would suggest that project A should reference B , which refers to C , which refers to NHibernate . This is not true. I find Project A needs a reference to B and C and NHibernate ! I do not like the idea of my web application requiring knowledge of my internal architecture and I especially do not want him to know that I am using NHibernate as my ORM.
Is there any way to tell these projects to use transitive dependencies when resolving their references?
My project is .NET 4 in Visual Studio 2010, if this information matters.
EDIT: I found this SO answer to the corresponding question, which explains that these links are only needed if the classes of project C pop up from project B I was very configured so that there were no leaks between the layers, and I know that Hibernate classes are only used in C , so maybe I just don't get it right ...