Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

3-Tier Architecture

Lesson 4 of 27 in the free C# Programming notes on Siksha Sarovar, written by Rohit Jangra.

Understanding 3-Tier Architecture

In modern software engineering, separating concerns is vital for maintenance. The 3-Tier architecture is a classic design pattern that divides an application into three logical and physical computing tiers.

Study Deep: Scalability vs. Reusability

While often confused, 3-tier architecture provides both:

  1. Scalability: Because the layers are separate, you can host the Database on a high-RAM server, the BLL on a high-CPU server, and the UI on a web server. If your app gets more users, you just upgrade the specific server that is slow.
  2. Reusability: The BLL is "UI-agnostic." You can build a Desktop UI (WinForms) and a Web UI (ASP.NET) that both call the exact same BLL code. This ensures consistent business rules across all platforms.

The Three Layers

LayerNameResponsibilityExample Components
1. PresentationUser Interface (UI)Handles user interaction and displays data. It should contain no business logic.Windows Forms, ASP.NET Pages, HTML/CSS.
2. Business LogicBLL (Business Logic Layer)The "Brain" of the app. Processes data, performs calculations, and validates rules.C# Classes, Calculations services.
3. Data AccessDAL (Data Access Layer)Communicates with the database. Executes queries (CRUD operations).ADO.NET, Entity Framework, SQL Stored Procs.

Deep Dive: Why split them?

Imagine you write all your code in one file (Button click event). If you need to change your database from SQL Server to Oracle, you have to rewrite your entire UI code!

In 3-Tier:

  • Scalability: You can put the Database on Server A, Business Logic on Server B, and UI on client machines.
  • Maintainability: A team of UI designers can work on the Presentation Layer while backend engineers work on the BLL/DAL.
  • Reusability: The same Business Logic can be used by a Web App, a Mobile App, and a Desktop App simultaneously.

Data Flow

User enters data (UI) -> UI sends to BLL -> BLL validates and sends to DAL -> DAL saves to Database.