Solved

3 layer architecture for ASP.net Website

Posted on 2013-11-13
7
254 Views
Last Modified: 2013-11-19
I am creating a ASP.net website. I want to have it in 3-layer architecture.
I have attached the image of solution explorer of my website. Can anyone suggest how my website in solution explorer should look for 3 layer architecture.
0
Comment
Question by:Raj_donet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39644955
Image?

In my experience, when you have a 3-layer architecture, you end up having one project per layer. This approach makes it easy to swap out a layer if you have to make changes in the future. For example:

Screenshot
You have a layer to interact with the database, a layer to enforce your business rules (like validation), and a layer to display information to the user. You should be able to swap out any layer without causing significant (ideally no) change in any other layer.
0
 

Author Comment

by:Raj_donet
ID: 39645257
Mine is ASP.Net website not web application. Please see the attachment.
Untitled.png
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39645304
That is inconsequential. My comment still holds.
0
Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

 

Author Comment

by:Raj_donet
ID: 39645307
How can I create seperate projects in a website
It would be helful, if you can explain.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39645578
Right-click the solution within Solution Explorer, then select Add->New Project.

Screenshot
The solution is the top-most item within the Solution Explorer. You would be adding library projects:

Screenshot
...one for each layer (except the site itself, which is your UI layer).
0
 

Author Comment

by:Raj_donet
ID: 39647827
since they are going to be in different projects, should I include the dlls to access them?
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39647856
You should "Add Reference"s to them, yes. But typically your UI layer does not know about your Data layer; it only knows about the Business layer (meaning your UI layer would only have a reference to the Business layer project). Your Business layer only knows about the Data layer; it does not know about the UI layer (meaning your Business layer would only have a reference to the Data layer project). The Data layer knows about neither the UI layer nor the Business layer, so it has no references to either project. So graphically:

UI Layer -->  Business Layer  -->  Data Layer

..where each arrow represents a reference to another project. Maintaining this practice allows you to minimize the number of dependencies (and ideally the number of changes) between projects.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question