projects in solution
I am wondering how divide large scale application into projects. Does I need to create:
1. one project for the data access layer. 2. one p开发者_如何转开发roject for the business logic layer. 3. one project for the web application. ?should I put the data access layer and the business login layer together?
in addition, does the data access layer should depend on the business login layer?
should the web application depend on the data access layer directly? (does is should use methods from the data access layer on work using objects from the business login layer)?
right now I have two projects:
1. web application. 2. all the code including data access and business objects.Download Microsoft Application Architecture Guide, 2nd Edition here, I'm now reading it and it is very helpful on the subject:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ce40e4e1-9838-4c89-a197-a373b2a60df2
I typically keep my projects seperate:
Solution
->Presentation Tier
->Business Tier
->Data Tier
I then add reference from Presentation to Business and Business to Data. I never let my Presentation interact directly from Data. Typically I also utilize services in my Business layer that can be deployed to separate location if necessary.
It depends on what you mean by a "very large project."
We are writing an MVC application and we have split it into several assemblies... one for each of the databases we're accessing. But it's not just DAL, it's got SOME special logic in there as well. This assembly also has some common functionality.
We then have a common web project.
We then have a web project for each of the 3 sites that use this data, they all depend on the common project.
It will probably be easier to maintain and develop if you split it into at least 3 assemblies. Here's why.
- It forces you to have a separation of concerns, need to get something out of the data? Put it in the data assembly. Need to modify some javascript? Put it in the presentation.
- It allows for specialization. You can get a stud back-end developer, or a javascript guru, and they can work on just their assembly without effecting anyone else.
- If something on the front end changes, and you want to go to a new front end, there's a good chance the DAL and business layer wouldn't need as many changes.
精彩评论