Introduction to .net framework
.net framework is developed by Microsoft. It is mainly developed for the INTERNET programming. It is a type safety environment and manages all aspects of program execution like allocation of memory for storage of data and instruction. It support cross language capability.The application developed in VB.net can be referenced in ASP.net or C#.net.
.net is designed to provide :
- Increase interactive for web sites.
- Integrate various communication media namely e-mail, fax, tele phone etc.
- The ability of re-usability.
Components of .net framework
The basis of this new
development platform consists of three primary components or layers:
- common language runtime
- .NET Framework base classes
- user and program interfaces
net framework architecture:
The following are the components of .net framework
architecture.
COMMON LANGUAGE RUNTIME (CLR):
- The CLR is the foundation upon which the .NET Framework has been built.
- The runtime manages code at execution time and provides all the core services such as memory management, thread management and remoting.
CLR Features
- CLR manages memory, thread execution, code execution, compilation code safety verification and other system services.
- For security reasons, managed code is assigned varying degrees of trust based on origin. This prevents or allows the managed component from performing file access operations, registry access operations or other sensitive functions even within the same active application.
- The Runtime enforces code robustness by implementing strict type and code verification infrastructure called Common type System (CTS). The CTS ensures that all managed code is self describing and all Microsoft or third party language compiler generated codes conform to CTS. This enables the managed code to consume other managed types and enforce strict type fidelity and type safety.
- CLR eliminates many common software issues like handling of object layout, references to objects and garbage clearance. This type of memory management prevents memory leaks and invalid memory references.
- The CLR also accelerates developer productivity. The programmer is free to choose the language of the application without worrying about compatibility and integration issues. He is also enabled to take advantage of the runtime and the class library of the .NET Framework and also harvest components from other applications written in different languages by different developers. This implicitly eases the process of migration.
- Though CLR aims to be futuristic software, it lends support to existing applications. The interoperability between the managed and unmanaged codes makes this process extremely simple.
- The design of the CLR is geared towards enhancing performance. The Just-in-time (JIT) compiling enables managed code to run in the native machine language of the system executing it. During the process the memory manager removes the possibilities of fragmented memory and increases memory locality-of-reference to enhance performance.
- Finally, server side applications can host runtime. High performance servers like Microsoft SQL Server and Internet Information Services can host this CLR and the infrastructure so provided can be used to write business logic while enjoying the best benefits of enterprise server support.
Class Library
- A blueprint of an object is called a class. All definitions of haw a particular object will be instantiated at runtime, its properties and methods and storage structures are defined in the class.
- Classes are used by developers for creating instances of the class at runtime using the keyword “New”.
- The Class Library is an object oriented collection of reusable types. It is comprehensive and the types can be used to develop command line applications or GUI applications such as Web forms or XML Web services.
- Unmanaged components that load CLR into their processes can be hosted by the .NET Framework to initiate the execution of managed code. This creates a software environment that exploits both the managed and unmanaged codes.
- The.NET Framework also provides a number of runtime hosts and supports third party runtime hosts.
Class Library Features
1. The class library is a collection of reusable types that
integrate with the CLR.
2. It is object oriented and provides types from which user
defined types can derive functionality. This makes for ease of use and is time
saving.
3. Third party components can be integrated seamlessly with
classes in the .NET framework.
4. It enables a range of common programming tasks such as
string management, data collection and file access.
5. It supports a variety of specialized development
scenarios such as console application development, Windows GUI applications,
ASP.NET Applications, XML Web services.
The Common Type System (CTS)
- A number of types are supported by the CLR and are described by the CTS. Both value types are supported—primitive data types and reference types.
- The primitive data types include Byte, Int16, Double and Boolean while Reference types include arrays, classes and object and string types.
- Reference types are types that store a reference to the location of their values. The value is stored as part of a defined class and is referenced through a class member on the instance of a class.
- User defined value types and enumerations are derived from the value types mentioned above.