?
Solved

3 layer architecture for ASP.net Website

Posted on 2013-11-13
7
Medium Priority
?
256 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 

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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
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…
Suggested Courses

770 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