Solved

3 layer architecture for ASP.net Website

Posted on 2013-11-13
7
252 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
  • 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

777 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