Solved

3 layer architecture for ASP.net Website

Posted on 2013-11-13
7
250 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 74

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 74

Expert Comment

by:käµfm³d 👽
ID: 39645304
That is inconsequential. My comment still holds.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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 74

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 74

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 Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In this article I will describe the Backup & Restore 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.
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 viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now