SlideShare ist ein Scribd-Unternehmen logo
1 von 7
In this asp.net tutorial you will learn how to implement 3-tier architecture in asp.net
using c#. 3-Tier architecture is also called layered architecture. Some people called it n-tier
architecture. Layer architectures are essentially objects and work in object oriented environment
just like asp.net. 3-tier architecture is a very well known architecture in the world of software
development, it doesn't matter whether you are developing web based application or desktop
based, it is the best architecture to use.
3-Tier Architecture in asp.net using c#

3-Tier architecture consists of
1) UI or Presentation Layer
2) Business Access Layer or Business Logic Layer
3) Data Access Layer
Presentation Layer
Presentation layer consists of pages like .aspx or desktop based form where data is presented to
users or getting input from users.
Business Logic layer or Business Access Layer
Business logic layer contains all of the business logic. Its responsibility is to validate the business
rules of the component and communicating with the Data Access Layer. Business Logic Layer is
the class in which we write functions that get data from Presentation Layer and send that data to
database through Data Access Layer.
Data Access Layer
Data Access Layer is also the class that contains methods to enable business logic layer to
connect the data and perform desired actions. These desired actions can be selecting, inserting,
updating and deleting the data. DAL accepts the data from BAL and sends it to the database or
DAL gets the data from the database and sends it to the business layer. In short, its
responsibility is to communicate with the backend structure.
Illustration of 3-Tier Architecture with Diagram

The figure clearly describe about the purpose of BAL and DAL. The main advantage of 3-tier
architecture is to separate the presentation layer from data access layer. You will not write any
function to communicate with database in presentation layer, all the required functions for
communication with database will be available in DataAcessLayer. Its mean at presentation layer
you will just focus at information that you will present in front of user.
I am going to create BAL, DAL in App_Code folder. You can also create separate projects for
BAL, DAL and UI (Your website) and referenced your DAL into BAL and BAL into UI. In that
scenario you have to rebuild the DAL and BAL every time, in order to view the change that you
have made in your BAL and DAL. So to get rid of rebuilding layers every time after change, I am
going to create BAL and DAL folder in App_Code. Now feel free to make changes in BAL and DAL
and just refresh the webpage to view the change that you made, in short no rebuilding of DAL
and BAL is required. The following figure shows the 3-tier architecture of our website that we are
going to made.
Design and implement 3-tier architecture

.

1) Open visual studio or visual web developer.
2) Go to File-> New Web Site

3) Select ASP.NET Web Site and then browse the Folder in which you want to save your web
pages.
4) Go to Solution Explorer and then right click on your website folder.
Go to Add ASP.NET Folder-> App_Code.

5) Now right click on App_Code Folder and select New Folder.

6) Create Two Folders and give BusinessLayer and DataAccessLayer names to them.
7) Now right click on DataAccessLayer -> Add New Item.

8) Select Class as template and give DbAccess name to that class.

9) Now right click on BusinessLayer folder-> Add New Item
10) Select Class as template and give BusComments.cs name to that class.

Now open your DbAccess.cs file placed in DataAccessLayer folder. Clear it by deleting all its builtin code and then copy/paste the following code in your DbAccess.cs file and then save it
10) Select Class as template and give BusComments.cs name to that class.

Now open your DbAccess.cs file placed in DataAccessLayer folder. Clear it by deleting all its builtin code and then copy/paste the following code in your DbAccess.cs file and then save it

Weitere ähnliche Inhalte

Was ist angesagt?

Free presentation template for web design projects
Free presentation template for web design projectsFree presentation template for web design projects
Free presentation template for web design projectsThomas Talavera Karslake
 
Lior rotkovitch ASM WAF unified learning – building policy with asm v12
Lior rotkovitch   ASM WAF  unified learning – building policy with asm v12Lior rotkovitch   ASM WAF  unified learning – building policy with asm v12
Lior rotkovitch ASM WAF unified learning – building policy with asm v12Lior Rotkovitch
 
Asm bot mitigations v3 final- lior rotkovitch
Asm bot mitigations v3 final- lior rotkovitchAsm bot mitigations v3 final- lior rotkovitch
Asm bot mitigations v3 final- lior rotkovitchLior Rotkovitch
 
Cloudflare Accredited Configuration Engineer (ACE)
 Cloudflare Accredited Configuration Engineer (ACE) Cloudflare Accredited Configuration Engineer (ACE)
Cloudflare Accredited Configuration Engineer (ACE)MoganaRam
 
Actividad No. 1.14: Replicación de datos en MySQL 5.1
Actividad No. 1.14: Replicación de datos en  MySQL 5.1Actividad No. 1.14: Replicación de datos en  MySQL 5.1
Actividad No. 1.14: Replicación de datos en MySQL 5.1Francisco Medina
 
LAMP Server Vulnerabilities
LAMP Server VulnerabilitiesLAMP Server Vulnerabilities
LAMP Server VulnerabilitiesJosh Howell
 
Охота на уязвимости Hadoop
Охота на уязвимости HadoopОхота на уязвимости Hadoop
Охота на уязвимости HadoopPositive Hack Days
 
Basic Wordpress PPT
Basic Wordpress PPT Basic Wordpress PPT
Basic Wordpress PPT mayur akabari
 
Web application security I
Web application security IWeb application security I
Web application security IMd Syed Ahamad
 
Web Socket ASM support lior rotkovitch
Web Socket ASM support   lior rotkovitchWeb Socket ASM support   lior rotkovitch
Web Socket ASM support lior rotkovitchLior Rotkovitch
 
Sql injection
Sql injectionSql injection
Sql injectionZidh
 
CNCF Online - Data Protection Guardrails using Open Policy Agent (OPA).pdf
CNCF Online - Data Protection Guardrails using Open Policy Agent (OPA).pdfCNCF Online - Data Protection Guardrails using Open Policy Agent (OPA).pdf
CNCF Online - Data Protection Guardrails using Open Policy Agent (OPA).pdfLibbySchulze
 
Web application security
Web application securityWeb application security
Web application securityKapil Sharma
 
Dos and don'ts in AWS
Dos and don'ts in AWSDos and don'ts in AWS
Dos and don'ts in AWSMarek Piątek
 
Sql injections - with example
Sql injections - with exampleSql injections - with example
Sql injections - with examplePrateek Chauhan
 
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS FilterX-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS FilterMasato Kinugawa
 

Was ist angesagt? (20)

Free presentation template for web design projects
Free presentation template for web design projectsFree presentation template for web design projects
Free presentation template for web design projects
 
Lior rotkovitch ASM WAF unified learning – building policy with asm v12
Lior rotkovitch   ASM WAF  unified learning – building policy with asm v12Lior rotkovitch   ASM WAF  unified learning – building policy with asm v12
Lior rotkovitch ASM WAF unified learning – building policy with asm v12
 
Asm bot mitigations v3 final- lior rotkovitch
Asm bot mitigations v3 final- lior rotkovitchAsm bot mitigations v3 final- lior rotkovitch
Asm bot mitigations v3 final- lior rotkovitch
 
Cloudflare Accredited Configuration Engineer (ACE)
 Cloudflare Accredited Configuration Engineer (ACE) Cloudflare Accredited Configuration Engineer (ACE)
Cloudflare Accredited Configuration Engineer (ACE)
 
Actividad No. 1.14: Replicación de datos en MySQL 5.1
Actividad No. 1.14: Replicación de datos en  MySQL 5.1Actividad No. 1.14: Replicación de datos en  MySQL 5.1
Actividad No. 1.14: Replicación de datos en MySQL 5.1
 
LAMP Server Vulnerabilities
LAMP Server VulnerabilitiesLAMP Server Vulnerabilities
LAMP Server Vulnerabilities
 
Охота на уязвимости Hadoop
Охота на уязвимости HadoopОхота на уязвимости Hadoop
Охота на уязвимости Hadoop
 
Basic Wordpress PPT
Basic Wordpress PPT Basic Wordpress PPT
Basic Wordpress PPT
 
Web application security I
Web application security IWeb application security I
Web application security I
 
Sql injection
Sql injectionSql injection
Sql injection
 
Web Socket ASM support lior rotkovitch
Web Socket ASM support   lior rotkovitchWeb Socket ASM support   lior rotkovitch
Web Socket ASM support lior rotkovitch
 
Sql injection
Sql injectionSql injection
Sql injection
 
CNCF Online - Data Protection Guardrails using Open Policy Agent (OPA).pdf
CNCF Online - Data Protection Guardrails using Open Policy Agent (OPA).pdfCNCF Online - Data Protection Guardrails using Open Policy Agent (OPA).pdf
CNCF Online - Data Protection Guardrails using Open Policy Agent (OPA).pdf
 
Aula 8 - SQL Injection
Aula 8 - SQL InjectionAula 8 - SQL Injection
Aula 8 - SQL Injection
 
PHP Security
PHP SecurityPHP Security
PHP Security
 
Testando API Rest com Insomnia Core
Testando API Rest com Insomnia CoreTestando API Rest com Insomnia Core
Testando API Rest com Insomnia Core
 
Web application security
Web application securityWeb application security
Web application security
 
Dos and don'ts in AWS
Dos and don'ts in AWSDos and don'ts in AWS
Dos and don'ts in AWS
 
Sql injections - with example
Sql injections - with exampleSql injections - with example
Sql injections - with example
 
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS FilterX-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
 

Andere mochten auch

3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architecturedouglasruml
 
Uu38tahun2004 ttg jalan
Uu38tahun2004 ttg jalanUu38tahun2004 ttg jalan
Uu38tahun2004 ttg jalankasatlantaspml
 
匠Netミニセミナー萩本
匠Netミニセミナー萩本匠Netミニセミナー萩本
匠Netミニセミナー萩本Hagimoto Junzo
 
weather-lamp
weather-lampweather-lamp
weather-lampnapo0703
 
価値デザインと並行して進めるエンタープライズアジャイルの姿
価値デザインと並行して進めるエンタープライズアジャイルの姿価値デザインと並行して進めるエンタープライズアジャイルの姿
価値デザインと並行して進めるエンタープライズアジャイルの姿Hagimoto Junzo
 
Jisaセミナー講演
Jisaセミナー講演Jisaセミナー講演
Jisaセミナー講演Hagimoto Junzo
 
Guia hotel quo vadis
Guia hotel quo vadisGuia hotel quo vadis
Guia hotel quo vadismanuelfabi
 
How to make presentations
How to make presentationsHow to make presentations
How to make presentationsSandeep Mishra
 
Ir 3 rd_sector_partner_programme
Ir 3 rd_sector_partner_programmeIr 3 rd_sector_partner_programme
Ir 3 rd_sector_partner_programmeAjay Kumar
 
Kumpulan Portofolio tysar budirianto 2015
Kumpulan Portofolio tysar budirianto 2015Kumpulan Portofolio tysar budirianto 2015
Kumpulan Portofolio tysar budirianto 2015Tysar Budirianto
 
W3 your learning profile
W3 your learning profileW3 your learning profile
W3 your learning profileeljaric
 
Pwc network-decommissioning-redacted copy
Pwc network-decommissioning-redacted copyPwc network-decommissioning-redacted copy
Pwc network-decommissioning-redacted copyRachel Mc Hugh
 

Andere mochten auch (20)

3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architecture
 
Lines
LinesLines
Lines
 
Uu38tahun2004 ttg jalan
Uu38tahun2004 ttg jalanUu38tahun2004 ttg jalan
Uu38tahun2004 ttg jalan
 
Digitechx Services
Digitechx ServicesDigitechx Services
Digitechx Services
 
Kuliah Biologi Dasar: KEHATI
Kuliah Biologi Dasar: KEHATIKuliah Biologi Dasar: KEHATI
Kuliah Biologi Dasar: KEHATI
 
匠Netミニセミナー萩本
匠Netミニセミナー萩本匠Netミニセミナー萩本
匠Netミニセミナー萩本
 
css
csscss
css
 
weather-lamp
weather-lampweather-lamp
weather-lamp
 
Rain org
Rain orgRain org
Rain org
 
価値デザインと並行して進めるエンタープライズアジャイルの姿
価値デザインと並行して進めるエンタープライズアジャイルの姿価値デザインと並行して進めるエンタープライズアジャイルの姿
価値デザインと並行して進めるエンタープライズアジャイルの姿
 
Mao
MaoMao
Mao
 
SQL
SQLSQL
SQL
 
Jisaセミナー講演
Jisaセミナー講演Jisaセミナー講演
Jisaセミナー講演
 
boost ur income
boost ur incomeboost ur income
boost ur income
 
Guia hotel quo vadis
Guia hotel quo vadisGuia hotel quo vadis
Guia hotel quo vadis
 
How to make presentations
How to make presentationsHow to make presentations
How to make presentations
 
Ir 3 rd_sector_partner_programme
Ir 3 rd_sector_partner_programmeIr 3 rd_sector_partner_programme
Ir 3 rd_sector_partner_programme
 
Kumpulan Portofolio tysar budirianto 2015
Kumpulan Portofolio tysar budirianto 2015Kumpulan Portofolio tysar budirianto 2015
Kumpulan Portofolio tysar budirianto 2015
 
W3 your learning profile
W3 your learning profileW3 your learning profile
W3 your learning profile
 
Pwc network-decommissioning-redacted copy
Pwc network-decommissioning-redacted copyPwc network-decommissioning-redacted copy
Pwc network-decommissioning-redacted copy
 

Ähnlich wie 3 tier architecture in asp.net

ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010vchircu
 
3-Tier Architecture Step By Step Exercises
3-Tier Architecture Step By Step Exercises3-Tier Architecture Step By Step Exercises
3-Tier Architecture Step By Step ExercisesMiranda Anderson
 
Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web MahmoudOHassouna
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPAli Shah
 
Oracle application express
Oracle application expressOracle application express
Oracle application expressAbhinaw Kumar
 
Tuning and optimizing webcenter spaces application white paper
Tuning and optimizing webcenter spaces application white paperTuning and optimizing webcenter spaces application white paper
Tuning and optimizing webcenter spaces application white paperVinay Kumar
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studioAravindharamanan S
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studioAravindharamanan S
 
Oracle application express ppt
Oracle application express pptOracle application express ppt
Oracle application express pptAbhinaw Kumar
 
PURPOSE of the project is Williams Specialty Company (WSC) reque.docx
PURPOSE of the project is Williams Specialty Company (WSC) reque.docxPURPOSE of the project is Williams Specialty Company (WSC) reque.docx
PURPOSE of the project is Williams Specialty Company (WSC) reque.docxamrit47
 
Aspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAlfa Gama Omega
 
PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#Michael Heron
 

Ähnlich wie 3 tier architecture in asp.net (20)

A
AA
A
 
Mvc acchitecture
Mvc acchitectureMvc acchitecture
Mvc acchitecture
 
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
 
ASP.NET MVC3 RAD
ASP.NET MVC3 RADASP.NET MVC3 RAD
ASP.NET MVC3 RAD
 
unit 3.docx
unit 3.docxunit 3.docx
unit 3.docx
 
3-Tier Architecture Step By Step Exercises
3-Tier Architecture Step By Step Exercises3-Tier Architecture Step By Step Exercises
3-Tier Architecture Step By Step Exercises
 
Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
 
Oracle application express
Oracle application expressOracle application express
Oracle application express
 
Scaffolding
ScaffoldingScaffolding
Scaffolding
 
Tuning and optimizing webcenter spaces application white paper
Tuning and optimizing webcenter spaces application white paperTuning and optimizing webcenter spaces application white paper
Tuning and optimizing webcenter spaces application white paper
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
Oracle application express ppt
Oracle application express pptOracle application express ppt
Oracle application express ppt
 
PURPOSE of the project is Williams Specialty Company (WSC) reque.docx
PURPOSE of the project is Williams Specialty Company (WSC) reque.docxPURPOSE of the project is Williams Specialty Company (WSC) reque.docx
PURPOSE of the project is Williams Specialty Company (WSC) reque.docx
 
Salesforce
SalesforceSalesforce
Salesforce
 
CAD Report
CAD ReportCAD Report
CAD Report
 
Aspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_cs
 
PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#
 
ASP.NET Identity
ASP.NET IdentityASP.NET Identity
ASP.NET Identity
 

Kürzlich hochgeladen

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Kürzlich hochgeladen (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

3 tier architecture in asp.net

  • 1. In this asp.net tutorial you will learn how to implement 3-tier architecture in asp.net using c#. 3-Tier architecture is also called layered architecture. Some people called it n-tier architecture. Layer architectures are essentially objects and work in object oriented environment just like asp.net. 3-tier architecture is a very well known architecture in the world of software development, it doesn't matter whether you are developing web based application or desktop based, it is the best architecture to use. 3-Tier Architecture in asp.net using c# 3-Tier architecture consists of 1) UI or Presentation Layer 2) Business Access Layer or Business Logic Layer 3) Data Access Layer Presentation Layer Presentation layer consists of pages like .aspx or desktop based form where data is presented to users or getting input from users. Business Logic layer or Business Access Layer Business logic layer contains all of the business logic. Its responsibility is to validate the business rules of the component and communicating with the Data Access Layer. Business Logic Layer is the class in which we write functions that get data from Presentation Layer and send that data to database through Data Access Layer. Data Access Layer
  • 2. Data Access Layer is also the class that contains methods to enable business logic layer to connect the data and perform desired actions. These desired actions can be selecting, inserting, updating and deleting the data. DAL accepts the data from BAL and sends it to the database or DAL gets the data from the database and sends it to the business layer. In short, its responsibility is to communicate with the backend structure. Illustration of 3-Tier Architecture with Diagram The figure clearly describe about the purpose of BAL and DAL. The main advantage of 3-tier architecture is to separate the presentation layer from data access layer. You will not write any function to communicate with database in presentation layer, all the required functions for communication with database will be available in DataAcessLayer. Its mean at presentation layer you will just focus at information that you will present in front of user. I am going to create BAL, DAL in App_Code folder. You can also create separate projects for BAL, DAL and UI (Your website) and referenced your DAL into BAL and BAL into UI. In that scenario you have to rebuild the DAL and BAL every time, in order to view the change that you have made in your BAL and DAL. So to get rid of rebuilding layers every time after change, I am going to create BAL and DAL folder in App_Code. Now feel free to make changes in BAL and DAL and just refresh the webpage to view the change that you made, in short no rebuilding of DAL and BAL is required. The following figure shows the 3-tier architecture of our website that we are going to made.
  • 3. Design and implement 3-tier architecture . 1) Open visual studio or visual web developer. 2) Go to File-> New Web Site 3) Select ASP.NET Web Site and then browse the Folder in which you want to save your web pages.
  • 4. 4) Go to Solution Explorer and then right click on your website folder. Go to Add ASP.NET Folder-> App_Code. 5) Now right click on App_Code Folder and select New Folder. 6) Create Two Folders and give BusinessLayer and DataAccessLayer names to them.
  • 5. 7) Now right click on DataAccessLayer -> Add New Item. 8) Select Class as template and give DbAccess name to that class. 9) Now right click on BusinessLayer folder-> Add New Item
  • 6. 10) Select Class as template and give BusComments.cs name to that class. Now open your DbAccess.cs file placed in DataAccessLayer folder. Clear it by deleting all its builtin code and then copy/paste the following code in your DbAccess.cs file and then save it
  • 7. 10) Select Class as template and give BusComments.cs name to that class. Now open your DbAccess.cs file placed in DataAccessLayer folder. Clear it by deleting all its builtin code and then copy/paste the following code in your DbAccess.cs file and then save it