Framework

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

.

NET Framework

1.1 Microsoft.NET is a Framework

• .net is a run time environment or platform providing services & extensive


set of libraries to application and developers

• Microsoft announced the .NET initiative in July 2000.

• The main intention was to bridge the gap in interoperability between


services of various programming languages

.NET Framework Objectives

• The .NET Framework is designed to fulfill the following objectives:

– Provide object-oriented programming environment

– Provide environment for developing various types of applications,


such as Windows-based applications and Web-based applications

– To ensure that code based on the .NET Framework can integrate


with any other code

Faculty Name: Asst.Prof. Nayna N Mistry (MCA, NET, GSET)


Sutex Bank College Of Computer Science and Applications Page 1
.NET Framework

Architecture

The .NET Framework consists of:

(1) Common Language Runtime (CLR)

• .NET Framework provides runtime environment called Common


Language Runtime (CLR).

• It is the heart of .net framework. It is the engine that compiles and


run the application. It uses MSIL code which is language
independent for execution. The MSIL code is translated by JIT
compiler

• It provides an environment to run all the .NET Programs.

• The code which runs under the CLR is called as Managed Code.

• Programmers need not to worry on managing the memory if the


programs are running under the CLR as it provides memory
management and thread management.

Faculty Name: Asst.Prof. Nayna N Mistry (MCA, NET, GSET)


Sutex Bank College Of Computer Science and Applications Page 2
.NET Framework

Execution In CLR

Microsoft Intermediate Language

• MSIL stands for Microsoft Intermediate Language. We can call it as


Intermediate Language (IL) or Common Intermediate Language (CIL).

• The .NET Compiler will create MSIL while you run your program and JIT
(Just in Time compiler) will convert your Intermediate Language to
machine code (Native Code).

• Microsoft Intermediate Language (MSIL) is a CPU-independent set of


instructions that can be efficiently converted to the native code.

• Microsoft Intermediate Language is also called Mange Code

• When a compiler produces Microsoft Intermediate Language (MSIL), it


also produces Metadata (Data about Data).

• Metadata is nothing but a description of every namespace,class,method

Property etc. contained within the PE file.

Faculty Name: Asst.Prof. Nayna N Mistry (MCA, NET, GSET)


Sutex Bank College Of Computer Science and Applications Page 3
.NET Framework

• The Microsoft Intermediate Language (MSIL) and Metadata are contained


in a portable executable (PE) file.

• Microsoft Intermediate Language (MSIL) includes instructions for


loading, storing, initializing, and calling methods on objects

(2) Base Class Libraries (BCL)

• It is also known as framework class library(FCL)

• It is the object-oriented collection of reusable types. It is a Library of


prepackaged functionality and Applications.

• It provides classes which encapsulate a number of common function,


including file reading & writing,Grahics rendering ,database
interaction and XML document manipulation

Faculty Name: Asst.Prof. Nayna N Mistry (MCA, NET, GSET)


Sutex Bank College Of Computer Science and Applications Page 4
.NET Framework

(3) ADO.Net and XML

• It is also known as data access layer. With the help of this layer we can
access relational databases. it work with XML and provides the
Disconnected Data Model)

• It is a part of BCL.it consists of two parts

– Data Provider

Data Set

(4) Window Forms

• It is also know as Win Forms. It is used to create GUI for windows


desktop application.

• it also provides integrated and unified way of developing GUI

• It has a rich variety of windows controls and user interface support like
Textbox, Button, Checkbox, Etc.

• Using visual Studio.NET, we can simply design the GUI by dragging the
controls on a form.

(5) Web Forms & web Services

• It provides a tool for web application. It is a part of ASP. Net

• It is the forms engine that provides Browser –based user interface.

• Web Forms are similar to Windows Forms in that they provide properties,
methods, and events for the controls that are placed onto them.

• However, these UI elements render themselves in the appropriate


markup language required by the request, e.g. HTML.

• If you use Microsoft Visual Studio® .NET, you will also get the familiar
drag-and-drop interface used to create your UI for your Web application

Faculty Name: Asst.Prof. Nayna N Mistry (MCA, NET, GSET)


Sutex Bank College Of Computer Science and Applications Page 5
.NET Framework

Web Services

Web services are the applications that run on a web server and
communicate with other application. It uses a series of XML based
communicating protocols that respond to different requests.

The protocols on which web services are built summarized below:

UDDI (Universal Discovery and Description Integration)

WSDL (Web services Description Language)

SOAP (Simple Object Access Protocol)

XML (Extensible Markup Language),HTTP(Hypertext Markup


Language),SMTP(Simple Mail Transfer Protocol)

(6) The Common Language Specification (CLS)

• It is a set of rules and constraints that all language must follow


which want to be compatible with .NET framework.

• It is used to support the theme of .NET i.e. unification and


interoperability. That means, if we want the code which we write in
a language to be used by programs in other language then it
should hold on to the CLS.

• Thus the CLS describes a set of features that are common to


different languages.

CLS performs the following functions:

• Establishes a framework that helps enable cross-language


integration, type safety, and high performance code execution

• Provides an object-oriented model that supports the complete


implementation of many programming languages

• Defines rules that languages must follow, which helps ensure that
objects written in different languages can interact with each other

Faculty Name: Asst.Prof. Nayna N Mistry (MCA, NET, GSET)


Sutex Bank College Of Computer Science and Applications Page 6
.NET Framework

Some Concept which are important in .Net

Metadata

• When a compiler produces Microsoft Intermediate Language (MSIL), it


also produces Metadata (Data about Data).

• Metadata is nothing but a description of every namespace,class,method

Property etc. contained within the PE file.

• The Microsoft Intermediate Language (MSIL) and Metadata are contained


in a portable executable (PE) file.

• It allows loading and locating code, enforcing code security, generating


native code, and providing reflection at runtime.

Assembly

– It is the smallest executable code of the application. it contains


data for the resources.

– We need specific permission to access the assembly. it is develop in


the form of classes.

– These assemblies are public so that other assembly can use it.

– It also contains the version information.

Faculty Name: Asst.Prof. Nayna N Mistry (MCA, NET, GSET)


Sutex Bank College Of Computer Science and Applications Page 7
.NET Framework

Managed Module
(MSIL and
Metadata ) Assembly

Manifest
Managed Module
(MSIL and
Metadata)

Multiple managed
module and
Resource File resource files are
compiled to produce
an assembly

15

Manifest

• It is within the assembly which is formed by collecting the core


information for the assembly.

• It contains

• Version information

• Security information

• List of other assemblies etc.

Namespace

• Namespace is the Logical group of types

• We can say Namespace is a container (e.g. Class, Structures, Interfaces,


and Enumerations etc.),

• example System.IO logically groups input output related features

• System.Data.SqlClient is the logical group of ado.net Connectivity with


Sql server related features.

Faculty Name: Asst.Prof. Nayna N Mistry (MCA, NET, GSET)


Sutex Bank College Of Computer Science and Applications Page 8
.NET Framework

1.2 Common Language Runtime (CLR)

• .NET Framework provides runtime environment called Common


Language Runtime (CLR).

• It is the heart of .net framework. It is the engine that compiles and


run the application. It uses MSIL code which is language
independent foe execution. The MSIL code is translated by JIT
compiler

• It provides an environment to run all the .NET Programs.

• The code which runs under the CLR is called as Managed Code.

• Programmers need not to worry on managing the memory if the


programs are running under the CLR as it provides memory
management and thread management.

Execution In CLR

Faculty Name: Asst.Prof. Nayna N Mistry (MCA, NET, GSET)


Sutex Bank College Of Computer Science and Applications Page 9
.NET Framework

• When the .NET program is compiled, the output of the compiler is not an
executable file but a file that constraints a special type of code is called
Microsoft intermediate, which is a low level set of instructions
understand by CLR.

• The MSIL defines a set of portable instructions that are CPU


indendendent.

• It’s the job of the CLR to translate this MSIL into native code when the
program is executed, making the program to run in any environment for
which the CLR is implemented. And that’s how the .NET framework
achieves Portability.

• This MSIL is converts into Native code using JIT(Just In Time)compiler

Purpose of CLR

• Base class library: It provides all the types that an application need at
runtime.


• Thread Support: Threads are managed under the Common Language
Runtime. Threading means parallel code execution. Threads are basically

Faculty Name: Asst.Prof. Nayna N Mistry (MCA, NET, GSET)


Sutex Bank College Of Computer Science and Applications Page 10
.NET Framework

light weight processes responsible for multi-tasking within a single


application.

• COM Marshaler: It allows the communication between the application


and COM objects.

• Type Checker
Type checker will verify types used in the application with CTS or CLS
standards supported by CLR, this provides type safety.

• Exception Manager:
it handles all the runtime Exception exceptions thrown by application

• Security Engine: It enforces security permissions at code level security,


folder level security, and machine level security using Dot Net
Framework setting and tools provided by Dot Net.

• Debug Engine: CLR allows us to perform debugging an application


during runtime.

• MSIL: Microsoft Intermediate Language is considered to be the lowest


form of human readable language. It is CPU independent and includes
instructions of how to load, store, initialize objects. JIT converts this
MSIL into native code which is dependent on the CPU

• Code Manager: CLR manages code. When we compile a .NET application


you don't generate code that can actually execute on your machine. You
actually generate Microsoft Intermediate Language (MSIL or just IL). All
.NET code is IL code. IL code is also called Managed Code, because the
.NET Common Language Runtime manages it

• Garbage Collector
Garbage Collector handles automatic memory management and it will
release memory of unused objects in an application, this provides
automatic memory management.

• Class Loader:

– As and when needed. it loads the classes into the system memory

Faculty Name: Asst.Prof. Nayna N Mistry (MCA, NET, GSET)


Sutex Bank College Of Computer Science and Applications Page 11
.NET Framework

CTS

Common Type System (CTS) describes the data types that can be used by
managed code. CTS define how these types are declared, used and managed in
the runtime.

It facilitates cross-language integration, type safety, and high-performance code


execution. The rules defined in CTS can be used to define your own classes and
values.

In CTS, it deals with the data type. Here we have several languages and each
and every language has its own data type and 1 language data type cannot be
understandable by other languages but I can understand all the data types.

C# has int Data Type and VB.Net has Integer Data Type. Hence a variable
declared as int in C# or Integer in vb.net, finally after compilation, uses the
same structure Int32 from CTS

All the structures and classes available in CTS are common for all .NET
Languages and the purpose of these is to support language independence in
.NET. Hence it is called CTS.

Faculty Name: Asst.Prof. Nayna N Mistry (MCA, NET, GSET)


Sutex Bank College Of Computer Science and Applications Page 12

You might also like