Software Testing
What is Vulnerability Assessment? Testing Process, VAPT Scan Tool
Vulnerability Testing Vulnerability Testing also called Vulnerability Assessment is a process of...
An N-Tier Application program is one that is distributed among three or more separate computers in a distributed network.
The most common form of n-tier is the 3-tier Application, and it is classified into three categories.
This architecture model provides Software Developers to create Reusable application/systems with maximum flexibility.
In N-tier, "N" refers to a number of tiers or layers are being used like – 2-tier, 3-tier or 4-tier, etc. It is also called “Multi-Tier Architecture”.
The n-tier architecture is an industry-proven software architecture model. It is suitable to support enterprise level client-server applications by providing solutions to scalability, security, fault tolerance, reusability, and maintainability. It helps developers to create flexible and reusable applications.
In this tutorial, you will learn-
A diagrammatic representation of an n-tier system depicts here – presentation, application, and database layers.
These three layers can be further subdivided into different sub-layers depending on the requirements.
Some of the popular sites who have applied this architecture are
Some common terms to remember, so as to understand the concept more clearly.
In this model, Client will serve as one set of program/code which executes a set of actions over the network. While Server, on the other hand, is a set of another program, which sends the result sets to the client system as requested.
There are different types of N-Tier Architectures, like 3-tier Architecture, 2-Tier Architecture and 1- Tier Architecture.
First, we will see 3-tier Architecture, which is very important.
By looking at the below diagram, you can easily identify that 3-tier architecture has three different layers.
Here we have taken a simple example of student form to understand all these three layers. It has information about a student like – Name, Address, Email, and Picture.
User Interface Layer or Presentation Layer
Presentation Layer
private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e) { // Object of the Property layer clsStudent objproperty=new clsStudent(); // Object of the business layer clsStudentInfo objbs=new clsStudentInfo(); // Object of the dataset in which we receive the data sent by the business layer DataSet ds=new DataSet(); // here we are placing the value in the property using the object of the //property layer objproperty.id=int.Parse(DataGridl.SelectedItem.Cells[1].Text.ToString()); // In this following code we are calling a function from the business layer and // passing the object of the property layer which will carry the ID till the database. ds=objbs.GetAllStudentBsIDWise(objproperty); // What ever the data has been returned by the above function into the dataset //is being populate through the presentation laye. txtId.Text=ds.Tables[0].Rows[0][0].ToString(); txtFname.Text=ds.Tables[0].Rows[0][1].ToString(); txtAddress.Text=ds.Tables[0].Rows[0][2].ToString(); txtemail.Text=ds.Tables[0].Rows[0][3].ToString();
Code Explanation
Business Access Layer -
This is the function of the business layer which accepts the data from the application layer and passes it to the data layer.
// this is the function of the business layer which accepts the data from the //application layer and passes it to the data layer. public class clsStudentInfo { public DataSet GetAllStudentBsIDWise(clsStudent obj) { DataSet ds=new DataSet(); ds=objdt.getdata_dtIDWise(obj);// Calling of Data layer function return ds; } }
Explanation of code
The code is using the function of business layer, which will accept the data for the application layer and passed it to the data layer. The Business layer codes act as a mediator between the functions defined in the presentation layer and data layer and calling the functions vice -versa.
Data Access Layer
This is the data layer function, which receives the data from the business layer and performs the necessary operation into the database.
// this is the datalayer function which is receiving the data from the business //layer and performing the required operation into the database public class clsStudentData // Data layer class { // object of property layer class public DataSet getdata_dtIDUise(clsStudent obj) { DataSet ds; string sql; sql="select * from student where Studentld=" +obj.id+ "order by Studentld; ds=new DataSet(); //this is the datalayer function which accepts the sql query and performs the //corresponding operation ds=objdt.ExecuteSql(sql); return ds; } }
Explanation of code
The code defines in dataset layer above accepts the entire request: requested by the system and performing the required operations into the database.
It is like Client-Server architecture, where communication takes place between client and server.
In this type of software architecture, the presentation layer or user interface layer runs on the client side while dataset layer gets executed and stored on server side.
There is no Business logic layer or immediate layer in between client and server.
It is the simplest one as it is equivalent to running the application on the personal computer. All of the required components for an application to run are on a single application or server.
Presentation layer, Business logic layer, and data layer are all located on a single machine.
Advantages | Disadvantages |
|
|
|
|
| |
| |
| |
|
Hence, it is a part of a program which encrypts real-world business problems and determines how data can be updated, created, stored, or changed to get the complete task done.
Considering the software professionals must have a full control on all the layers of the architecture, tips on n-tier architecture are given as below
Summary:
The N-tier architecture helps to manage all the components (business layer, presentation layer, and database layer) of an application under one roof.
Applications thatuses small numbers of users on a local area network can benefit from n-tier architecture.
Such architectural design ascertains maintaining, scaling up and deploying an application on the Internet efficiently.
Vulnerability Testing Vulnerability Testing also called Vulnerability Assessment is a process of...
What is Performance testing? Performance testing is a type of testing for determining the speed of...
What is Frontend Testing? Frontend Testing is a type of testing that checks the Presentation layer of a 3...
Following are frequently asked questions in interviews for freshers as well experienced QA...
Training Summary Behavior Driven Development (BDD) is a rising methodology to test and check your...
Data Driven Testing Data Driven Testing is a software testing method in which test data is stored in...