Start with a simple Directcenter project to introduce this framework, directcenter mainly divided into user management, department management, the company manages three modules. First build the solution Directcenter:
Directcenter:
Directcenter.model (Class Library project) entity class Library, which includes the Hibernate mapping file (you can put the mapping file to the DAL layer, so that Model is also simpler, and the DAL is only the complete implementation of NHibernate)
Directcenter.idal (class Library project) data Access layer interface
Directcenter.dal (class Library project) database access layer implementation (with NHibernate)
DIRECTCENTER.IBLL (class Library project) business Layer Interface
DIRECTCENTER.BLL (class Library project) business layer implementation (using Idal, injecting the actual data access layer through the spring.net IOC)
Directcenter.app (Class Library project) system configuration, including some nhibernate,spring.net configuration information, the business layer of the DAL injection.
Directcenter.unittest (class Library project) uses NUnit to unit test the business layer
Directcenter.dto (class Library project) Data transform object for entities that interact with the foreground UI layer. The reason for this is to consider not just the Web project, but also other UIs, including WebService. (There may be a lot of people will ask the model already, why do I need a dto?)
Directcenter.controllers (Class Library project) Web controller. The user requests and the backend business layer's relay, receives and analyzes the user request, invokes the business layer completes the request, then distributes to the user. (Note that this is called IBLL, the business logic interface, and is injected into specific business implementations through the Spring.net IOC).
Directcenter.web (Web application) Simple view layer, mainly by ExtJS complete interface and AJAX request.
Of course, you can add a Controllers unit test project here, but I think it's not very useful here. Because here controllers work is more unified and simple.
First design and build the database, fields and descriptions are as follows: