Introduction to .NET framework

.NET framework mainly aimed to develop the applications for network use. 
Microsoft's concept behind .NET is to overcome the need of any other software on a machine other than .NET framework. However yet this is not achieved  i.e. applications developed in .NET still needs the windows environment.

Program developed for .NET framework execute in a software environment, known as CLR, that uses a library of thousands of classes to develop applications.
There are two main components of .NET framework:
  1. Class library
  2. Common Language Runtime..

Common Language Runtime(CLR)
It is the execution engine of .NET framework . All .NET programs execute under supervision of CLR. It is the module that actually runs your code or application.Code running under the control of CLR is often termed as managed code. It is an application virtual machine that provides important services such as security ,memory management ,exception handling etc.
Code has significant advantages: platform independence , performance improvement and language intreoperability.
(i). Platform Independence: Same file containing byte code instructions can be placed on any platform ; at runtime,the final stage of compilation can then easily accomplished so that the code will run on that particular platform.(however for windows only).
(ii)  Perfromance Improvement: IL is Just-in-Time compiled. Instead of compiling the entire application in one go, the JIT compiler simply compiles each portion of code as it is called(just in time), as a large portion of code is never used in any given run, therefore such code will never be compiled.
(iii). Language Interoperability :  you can compile to IL from one language and this compiled code should then be interoperable with code that has been compiled to IL from another language.
Class Library:
 Class library provides user interface ,data access ,connectivity ,cryptography ,web application ,numeric algorithms ,network communication
Organized in hierarchy of namespaces. Most of built in APIs contains a large number of common functions.
It is divided into two parts:
1). Base Class Library: A subset of library. Serves basic APIs of CLR . It provides features for reading, writing , adding graphics ,database etc. It contains mscorlib.dll , system.dll, system.core.dll.
2). Framework Class Library: It is the superset of BCL , entire class library that ships with .NET framework. It includes windows forms, ADO.NET , ASP.NET , Language integrated query.

  Source code is combined with .NET class library codes to produce software.
  Intended to be used by most new applications for windows platform.

Versions of .NET framework:
1.      .NET framework 1.0 in 2000
2.      .NET framework 3.0 with VS 2005
3.      .NET framework 3.5 with VS 2008
4.      .NET framework 4.0 with VS 2010.
5.      .NET framework 5.0 with VB 2012




Common Language Infrastructure:(CLI)
Provides language neutral platform for application development & execution , including exception handling ,Garbage Collection ,security , interoperability ,Implementation of CLI is called CLR or CL.
Common Type System:(CTS)
            Defines all possible data types & programming constructs supported by CLR. This acts as base for language interoperability.
Common Language Specification  (CLS) it works with CTS to ensure language interoperability. The CLS is a set of minimum standards that all compilers targeting .NET must support. However one can write non-CLS compliant code. However the compiled IL code ,in this case is not guaranteed to be fully language interoperable. e.g. IL is case sensitive
Assembly:
Building block of .NET framework. It provides CLR information and compiled code to run code. It holds IL codes of application. A program may generate more than one assemblies for interaction of application with .NET framework.
An assembly is completely self-describing and is a logical unit rather than physical unit, which means that it can be stored across more than one file.
 CIL code is housed in assembly, stored in portable executable PE format. Assembly contains many files one of which is manifest , which has the metadata for the assembly containing Name ,Version, Culture, Public Key etc.
There are two types of assemblies: Private and Public or Shared.
            (i)Private assembly:  It comes with the software and intended to be used by that software only. The system guarantees that private assemblies will not be used by other software because an application may load only private assemblies that are located in the same folder that the main executable is located in, or in a sub folder of it.
            (ii)Public assembly: These are  intended to be common libraries that any other application can use.Because any other software can access it , more precautions need to be taken against the following risks:
Name collision
Overridden by a different version of same assembly.
The solution is, all shared assemblies are placed in a special directory sub tree in file system,known as the Global Assembly Cache(GAC). It needs to be specifically installed on the cache.
To prevent name collision shared assemblies are given a name based on private key cryptography known as strong name.
For overriding problem a different version information is specified in manifest and allowing side by side installation.
Security:
Windows provides role based security. However .NET provides code  based security .
Role based security is based on the identity of the account under which the process is running. Code-based security , is based on what the code actually does and how much the code is trusted.
.NET have own security mechanism with two general features: Code Access Security and validation and verification.
It is based on evidence that is associated with a specific assembly. CA uses this evidence to determine permissions granted to the code. Every assembly of each method in the call stack(by CL) is checked for required permission.
 
Garbage Collection :
CLR takes care of all memory management functions with the help of garbage collection.The purpose of this program is  to clean up memory. The idea is that all dynamically allocated memory is allocated on the heap. When .NET detects that the managed heap for a given process becoming full and therefore needs tidying up, it calls garbage collector.You cannot guarantee when the garbage collection will be called ;it will be decided CLR, though it is also possible to override this process and call up the garbage collector in your code.

VB.NET : A language under .NET framework that provides four types of applications development:
1.      Windows forms applications(usually local to machine).
2.      Web forms (come to you across internet).
3.      Console applications (run in DOS windows).
4.      Mobile applications (that run on mobile devices like PC pocket).

Namespace:
It is organization of classes .Namespaces are the way that .NET avoids the name clashes between the classes.It is a group of data types , with all prefixed with the name of namespace. It is also possible to nest the namespaces with each other. Most commonly used namespace is System.
A .NET application can not be build without classes.
                        Eg: System.Windows.Forms.Form
                              System.Windows.Forms.Button.

VB.NET DATA TYPES
Byte                 1 byte                     0   255 (Unsigned)
Short                2 bytes                        (singed)
Integer             4 bytes                        (signed)
Long                8 bytes                       
Decimal           10 bytes
Single              4 bytes
Double             8 bytes
Boolean            2 bytes
Char                2 bytes
Date                8 bytes
Object             4 bytes
String               2 bytes

2 comments:

  1. Thank you for your guide to with upgrade information
    .NET Online Course

    ReplyDelete
  2. I am happy to know. thank you so much for giving us a chance to have this opportunity.. This is the exact information I am been searching for, Thanks for sharing the required infos with the clear update and required points.


    Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery

    ReplyDelete