N-Layered ASP.NET Application: One class library for all my layers or one class library for each layer?
N-Layered ASP.NET Application: One class library for all my layers or one class library
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your project is small enough that only one library suffices for each layer, then I would go with that approach. This helps to maintain a clear separation of concerns.
Separate DLLs will not adversly affect performance in my experience. There are some situations where it can assist performance (such as delay-loading rarely-used components). All the DLLs are loaded into the same address space, so as far as the runtime is concerned, one or many DLLs makes hardly any difference.
Each layer should be authored as though multiple front-ends are going to be using it. This will further help to maintain separation, and encourage code that is more correct and easier to maintain.