SlideShare a Scribd company logo
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

More Related Content

What's hot

Struts
StrutsStruts
Struts
s4al_com
 
Dynamic and Static Modeling
Dynamic and Static ModelingDynamic and Static Modeling
Dynamic and Static ModelingSaurabh Kumar
 
Convolutional Neural Networks
Convolutional Neural NetworksConvolutional Neural Networks
Convolutional Neural Networks
Ashray Bhandare
 
Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence
Yasir Khan
 
Wimp interface
Wimp interfaceWimp interface
Wimp interface
Abrish06
 
Convolutional neural network
Convolutional neural network Convolutional neural network
Convolutional neural network
Yan Xu
 
Deep Belief Networks
Deep Belief NetworksDeep Belief Networks
Deep Belief Networks
Hasan H Topcu
 
Artificial neural network for machine learning
Artificial neural network for machine learningArtificial neural network for machine learning
Artificial neural network for machine learning
grinu
 
Swarm intelligence
Swarm intelligenceSwarm intelligence
Swarm intelligence
Eslam Hamed
 
enterprise java bean
enterprise java beanenterprise java bean
enterprise java bean
Jitender Singh Lodhi
 
Last Mile Access Technologies
Last Mile Access TechnologiesLast Mile Access Technologies
Last Mile Access Technologies
Chamin Nalinda Loku Gam Hewage
 
Custom Controls in ASP.net
Custom Controls in ASP.netCustom Controls in ASP.net
Custom Controls in ASP.net
kunj desai
 
Object Detection & Tracking
Object Detection & TrackingObject Detection & Tracking
Object Detection & Tracking
Akshay Gujarathi
 
Convolutional neural network
Convolutional neural networkConvolutional neural network
Convolutional neural network
Itachi SK
 
strong slot and filler
strong slot and fillerstrong slot and filler
Layouts in android
Layouts in androidLayouts in android
Layouts in android
Durai S
 
interface
interfaceinterface
interface
rajshreemuthiah
 

What's hot (20)

Xen & virtualization
Xen & virtualizationXen & virtualization
Xen & virtualization
 
Struts
StrutsStruts
Struts
 
Dynamic and Static Modeling
Dynamic and Static ModelingDynamic and Static Modeling
Dynamic and Static Modeling
 
Convolutional Neural Networks
Convolutional Neural NetworksConvolutional Neural Networks
Convolutional Neural Networks
 
Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence
 
Wimp interface
Wimp interfaceWimp interface
Wimp interface
 
Convolutional neural network
Convolutional neural network Convolutional neural network
Convolutional neural network
 
Deep Belief Networks
Deep Belief NetworksDeep Belief Networks
Deep Belief Networks
 
Artificial neural network for machine learning
Artificial neural network for machine learningArtificial neural network for machine learning
Artificial neural network for machine learning
 
Swarm intelligence
Swarm intelligenceSwarm intelligence
Swarm intelligence
 
enterprise java bean
enterprise java beanenterprise java bean
enterprise java bean
 
Last Mile Access Technologies
Last Mile Access TechnologiesLast Mile Access Technologies
Last Mile Access Technologies
 
Custom Controls in ASP.net
Custom Controls in ASP.netCustom Controls in ASP.net
Custom Controls in ASP.net
 
Object Detection & Tracking
Object Detection & TrackingObject Detection & Tracking
Object Detection & Tracking
 
Convolutional neural network
Convolutional neural networkConvolutional neural network
Convolutional neural network
 
strong slot and filler
strong slot and fillerstrong slot and filler
strong slot and filler
 
Layouts in android
Layouts in androidLayouts in android
Layouts in android
 
interface
interfaceinterface
interface
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Design pattern-presentation
Design pattern-presentationDesign pattern-presentation
Design pattern-presentation
 

Viewers also liked

3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architecturedouglasruml
 
Uu38tahun2004 ttg jalan
Uu38tahun2004 ttg jalanUu38tahun2004 ttg jalan
Uu38tahun2004 ttg jalankasatlantaspml
 
Digitechx Services
Digitechx ServicesDigitechx Services
Digitechx Services
Rachel Mc Hugh
 
Kuliah Biologi Dasar: KEHATI
Kuliah Biologi Dasar: KEHATIKuliah Biologi Dasar: KEHATI
Kuliah Biologi Dasar: KEHATI
Dr. Bruri Melky Laimeheriwa
 
匠Netミニセミナー萩本
匠Netミニセミナー萩本匠Netミニセミナー萩本
匠Netミニセミナー萩本
Hagimoto Junzo
 
weather-lamp
weather-lampweather-lamp
weather-lamp
napo0703
 
価値デザインと並行して進めるエンタープライズアジャイルの姿
価値デザインと並行して進めるエンタープライズアジャイルの姿価値デザインと並行して進めるエンタープライズアジャイルの姿
価値デザインと並行して進めるエンタープライズアジャイルの姿
Hagimoto Junzo
 
SQL
SQLSQL
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 2015
Tysar 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 copy
Rachel Mc Hugh
 

Viewers also liked (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
 

Similar to 3 tier architecture in asp.net

A
AA
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
vchircu
 
unit 3.docx
unit 3.docxunit 3.docx
unit 3.docx
Sadhana Sreekanth
 
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
Miranda 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 @ ISP
Ali Shah
 
Oracle application express
Oracle application expressOracle application express
Oracle application express
Abhinaw Kumar
 
Scaffolding
ScaffoldingScaffolding
Scaffolding
DrMohamed Oaf
 
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
Vinay Kumar
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
Aravindharamanan S
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
Aravindharamanan 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.docx
amrit47
 
Salesforce
SalesforceSalesforce
Salesforce
maheswara reddy
 
Aspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_cs
Alfa Gama Omega
 
PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#
Michael Heron
 
ASP.NET Identity
ASP.NET IdentityASP.NET Identity
ASP.NET Identity
Suzanne Simmons
 

Similar to 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
 

Recently uploaded

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 

Recently uploaded (20)

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 

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