SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

Liferay 7: Come realizzare un client SOAP con Apache CXF in OSGi Style
Liferay 7: Come realizzare un client SOAP con Apache CXF in OSGi StyleLiferay 7: Come realizzare un client SOAP con Apache CXF in OSGi Style
Liferay 7: Come realizzare un client SOAP con Apache CXF in OSGi StyleAntonio Musarra
 
Apache Bigtop: a crash course in deploying a Hadoop bigdata management platform
Apache Bigtop: a crash course in deploying a Hadoop bigdata management platformApache Bigtop: a crash course in deploying a Hadoop bigdata management platform
Apache Bigtop: a crash course in deploying a Hadoop bigdata management platformrhatr
 
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍흥배 최
 
Microservices design patterns
Microservices design patternsMicroservices design patterns
Microservices design patternsMasashi Narumoto
 
Resilience reloaded - more resilience patterns
Resilience reloaded - more resilience patternsResilience reloaded - more resilience patterns
Resilience reloaded - more resilience patternsUwe Friedrichsen
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignYoung-Ho Cho
 
2012 06-15-jazoon12-sub138-eranea-large-apps-migration
2012 06-15-jazoon12-sub138-eranea-large-apps-migration2012 06-15-jazoon12-sub138-eranea-large-apps-migration
2012 06-15-jazoon12-sub138-eranea-large-apps-migrationDidier Durand
 
DevSecOps reference architectures 2018
DevSecOps reference architectures 2018DevSecOps reference architectures 2018
DevSecOps reference architectures 2018Sonatype
 
Hexagonal Rails
Hexagonal RailsHexagonal Rails
Hexagonal RailsLuiz Costa
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignNader Albert
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services ArchitectureAraf Karsh Hamid
 
Chaos Engineering - The Art of Breaking Things in Production
Chaos Engineering - The Art of Breaking Things in ProductionChaos Engineering - The Art of Breaking Things in Production
Chaos Engineering - The Art of Breaking Things in ProductionKeet Sugathadasa
 
Netweb flytxt-big-data-case-study
Netweb flytxt-big-data-case-studyNetweb flytxt-big-data-case-study
Netweb flytxt-big-data-case-studyIntelAPAC
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with MicronautQAware GmbH
 
DDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan PaulovichDDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan PaulovichIvan Paulovich
 

Tendances (20)

Liferay 7: Come realizzare un client SOAP con Apache CXF in OSGi Style
Liferay 7: Come realizzare un client SOAP con Apache CXF in OSGi StyleLiferay 7: Come realizzare un client SOAP con Apache CXF in OSGi Style
Liferay 7: Come realizzare un client SOAP con Apache CXF in OSGi Style
 
Reactive Design Patterns
Reactive Design PatternsReactive Design Patterns
Reactive Design Patterns
 
Apache Bigtop: a crash course in deploying a Hadoop bigdata management platform
Apache Bigtop: a crash course in deploying a Hadoop bigdata management platformApache Bigtop: a crash course in deploying a Hadoop bigdata management platform
Apache Bigtop: a crash course in deploying a Hadoop bigdata management platform
 
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
 
Microservices design patterns
Microservices design patternsMicroservices design patterns
Microservices design patterns
 
Resilience reloaded - more resilience patterns
Resilience reloaded - more resilience patternsResilience reloaded - more resilience patterns
Resilience reloaded - more resilience patterns
 
Patterns for distributed systems
Patterns for distributed systemsPatterns for distributed systems
Patterns for distributed systems
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
2012 06-15-jazoon12-sub138-eranea-large-apps-migration
2012 06-15-jazoon12-sub138-eranea-large-apps-migration2012 06-15-jazoon12-sub138-eranea-large-apps-migration
2012 06-15-jazoon12-sub138-eranea-large-apps-migration
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
DevSecOps reference architectures 2018
DevSecOps reference architectures 2018DevSecOps reference architectures 2018
DevSecOps reference architectures 2018
 
Hexagonal Rails
Hexagonal RailsHexagonal Rails
Hexagonal Rails
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Chaos Engineering - The Art of Breaking Things in Production
Chaos Engineering - The Art of Breaking Things in ProductionChaos Engineering - The Art of Breaking Things in Production
Chaos Engineering - The Art of Breaking Things in Production
 
Introducing DevOps
Introducing DevOpsIntroducing DevOps
Introducing DevOps
 
Netweb flytxt-big-data-case-study
Netweb flytxt-big-data-case-studyNetweb flytxt-big-data-case-study
Netweb flytxt-big-data-case-study
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with Micronaut
 
DDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan PaulovichDDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan Paulovich
 
(ARC307) Infrastructure as Code
(ARC307) Infrastructure as Code(ARC307) Infrastructure as Code
(ARC307) Infrastructure as Code
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Dernier (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

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