.NET Assemblies - II
This is a three series article.
-
In the first part we discussed 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-II :: Introduction to .NET Assemblies
ASP .NET introduces many techniques for better code management and code
reusability. Code Behind and Custom Controls are one
of the best implementations of these techniques where you can separate your HTML
tags and coding from your server-side script. It also provides future
facilities to manage the code easily.
The Code Behind and Custom Controls development
is a good approach to better web development, but there is a performance hit
that also exists. You may know about the CLR (Common Language Runtime),
I will not go into the detail of this, but just for a brief introduction, it is
the "black box" or the "heart" of the .NET where the compilation
of your code takes place. Whenever an ASP .NET page is opened or requested
by the user, the page gets compiled first and then is transferred to the user.
The compilation process is also completed in two steps. First of all an IL (Intermediate
Language) is generated and then this is handed over for JIT (Just
In Time) compilation which produces the machine code and our pages
get displayed with their dynamic content.
The performance of our web application can be improved by creating
pre-compiled libraries of IL which can then be handed over to JIT directly
without having the inclusion of an extra process to make the conversion. This
method is called componentization. Components are pre-compiled set of classes
that have been developed in the form of DLL files and can then be
included within our projects. This is also known as an assembly.
"An assembly is a logical grouping of functionality in a
physical file."
Understanding the assemblies and their concepts is the focus of
this article. An assembly has many benefits some of which are.
-
Increased performance.
-
Better code management and encapsulation.
-
Introduces the n-tier concepts and business logic.
You might have heard of the n-tier and three-tier
architecture concepts. (To know about the detail of 3-tier architectural
concepts please read Part-I of this article.). The practical implementation
of the three-tier architecture is also implemented by using the assemblies. In
the first part of this article we discussed about the Business Logic
layer. This layer is where we place all the business rules that apply to the
transactions that take place between the client and the server, and this layer
is implemented through components. The reason for this is that one we hide our
code and the business rules that have been applied (since the components are
in compiled binary form, so they are a mean of code encapsulation) and
second because they are more efficient (since the code is already transferred
into IL therefore only the JIT compilation takes place
instead of both the IL and JIT).
|