.NET Assemblies - I
This article is going to be based on three parts.
-
In the first part we will be discussing the 3-tier architecture.
-
In part-II of this article we will see what the .NET assemblies
are and
-
In the last part we will be practically implementing a simple
.NET assembly.
Part-I :: The Three-Tier Architecture
A 3-tier architecture defines the division of a web based application into
three layers. When we say 3-tier architecture, we are actually meaning the
number of nodes (or computers) that are involved within the communication. Let's
first of all see what do I mean when I say a 3-tier architecture or a n-tier
architecture.
For example, consider a simple scenario in which we have a client/server
architecture. A user simply connects with the server and communication starts.
The server fulfills all the requirements of the client as all of the contents
have been placed on the server. This type of architecture is called as a
client/server architecture or it can also be said as a two-tier architecture.
In a two-tier architecture the server contains all the contents that would be
requested from the client, the contents can include web pages, the
server-side technology implemented and the data-store. If we separate
the contents of the server-side technology from the web pages and
place them on a separate machine then this architecture would become a
three-tier architecture. Similarly if we keep on increasing the number of
machines in between our client/server communication then we would be
implementing the n-tier architecture for our communication.
Why do we need the three-tier architecture?
The three-tier architecture was introduced for better management of code and
contents and to improve the performance of the web based applications. Within
the three-tier architecture we divide our application into a set of three
layers.
-
Presentation
-
Business Logic
-
Database
-
The first layer Presentation contains the interface code,
that is going to be displayed to the user. This code could contain any
technology that can be used on the client side like HTML, JavaScript or
VBScript etc.
-
The second layer Business Logic contains all the code of the
server-side technology. This layer mainly contains the code that is used for
accessing the database and to query, manipulate, pass data to user interface
and handle any input from the UI as well.
-
The third and last layer Data represents the data store like
MS Access, SQL Server, an XML file, an Excel file or even a text file
containing data.
The following diagram shows the layers we have just described.

(Figure Displaying the layers of the three-tier
architecture)
One of the main benefits of the three-tier architecture is easy
management of the contents of the web application. Consider a scenario in which
you require to change the presentation of the web pages because you have
recently designed a new look for your website. In the case of two-tier
architecture you would require to change the web pages that would be containing
both the contents for the presentation as well as the business logic, this would
mean an headache for you to keep the code for business logic as it is and change
the code for the presentation layer. In case of a three-tier architecture the
code of the business logic would be residing on the middle layer, there for you
would be requiring only to make a change on the presentation layer containing
the code for your web page designs.Similarly if you require to change the database system for example, from Access
to Sql Server, then you would require only to change the database on the data
server without having to make any changes within the code of your business
logics.
The three-tier application design also enables for better
performing web applications, since the whole load of users is not placed upon a
single server. As we can see in the figure displaying the design of a three-tier
architectured web application, it can be seen that placing the business logic
and the database on the different machines reduces the load upon a single
server. Similarly we can implement any number of servers we like on the backend
of the application and such an architecture would be known as n-tier
architecture.
|