0% found this document useful (0 votes)
46 views38 pages

Introduction

The .NET Framework provides a common language runtime and class libraries for building and running applications. It includes features like memory management, type safety, version compatibility and language interoperability. Code compiled for the .NET Framework is executed by the common language runtime, which handles tasks like just-in-time compilation to native code and garbage collection. This allows applications to be developed in multiple languages while sharing a common execution environment.

Uploaded by

Rishika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views38 pages

Introduction

The .NET Framework provides a common language runtime and class libraries for building and running applications. It includes features like memory management, type safety, version compatibility and language interoperability. Code compiled for the .NET Framework is executed by the common language runtime, which handles tasks like just-in-time compilation to native code and garbage collection. This allows applications to be developed in multiple languages while sharing a common execution environment.

Uploaded by

Rishika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 38

Introduction to .

NET
.NET Framework
Evolution
Benefits
What is the .NET Framework?
Microsoft .NET is a Framework
– The .NET Framework is a managed execution environment that
provides a variety of services to its running applications.
– Microsoft announced the .NET initiative in July 2000.
– The main intention was to bridge the gap in interoperability
between services of various programming languages.

2
Contd…
• The services includes the following:
Memory management
A common type system
An extensive class library
Development frameworks and technologies
Language interoperability
Version compatibility
Side-by-side execution
Multitargeting
Client-side Environment
•The client-side environment used to run scripts is usually a browser.
•The processing takes place on the end users computer.
•The source code is transferred from the web server to the users
computer over the internet and run directly in the browser.
•The scripting language needs to be enabled on the client computer.
– Sometimes if a user is conscious of security risks they may switch the
scripting facility off. When this is the case a message usually pops up to
alert the user when script is attempting to run.
Server-side Environment
• The server-side environment that runs a scripting language is a web server.
• A user's request is fulfilled by running a script directly on the web server to
generate dynamic HTML pages.
• This HTML is then sent to the client browser. It is usually used to provide
interactive web sites that interface to databases or other data stores on the
server.
• This is different from client-side scripting where scripts are run by the viewing
web browser, usually in JavaScript.
• The primary advantage to server-side scripting is the ability to highly
customize the response based on the user's requirements, access rights, or
queries into data stores.
Evolution of .NET
The benefits of .NET
• .NET gives the best stage accessible today to deliver Windows software.
• .NET improves software, speedier, less expensive, and more secure.
• For developers, .NET gives a coordinated arrangement of devices for building Web
programming and administrations and Windows desktop applications.
• .NET backings different programming dialects and Service Oriented Architectures (SOA).
• For organizations, .NET gives a steady, versatile and secure condition for programming
improvement.
• .NET can bring down expenses by speeding improvement and associating frameworks,
increment deals by giving representatives access to the devices and data they require, and
interface your business to clients, providers and partners.

Contd…
• For end-clients, .NET outcomes in software that is more solid and
secure and takes a shot at various gadgets including laptops, Cell
phones and Pocket PCs.
• .NET is not limited to script languages, it allows you to make use
of .NET languages like C#, J#, VB, etc. It allows developers to build
very compelling applications by making use of Visual Studio, the
development tool provided by Microsoft.
• Advantages... It makes writing code simpler and faster.
Overview of the .NET Framework
• The .NET Framework is a technology that supports building and running the
next generation of applications and XML Web services.
• Contains all components for developing applications
• Compilers, code libraries, tool sets, Application Program Interface(API)
• Server side scripting technology
• Drastically reduces the amount of code required to build large applications,
• Easy to maintain and write. Also the source code is executed on the server.
This provides a lot of power and flexibility to the web pages.
• It has built-in Windows authentication feature and per-application
configuration that makes the applications are safe and secure.
Objectives
• To provide a consistent object-oriented programming environment (whether object code is
stored and executed locally, executed locally but Internet-distributed, or executed remotely)
• To provide a code-execution environment
– that minimizes software deployment and versioning conflicts
– that promotes safe execution of code, including code created by an unknown or semi-
trusted third party.
– that eliminates the performance problems of scripted or interpreted environments.
• To make the developer experience consistent across widely varying types of applications, such as
Windows-based applications and Web-based applications.
• To build all communication on industry standards to ensure that code based on the .NET
Framework can integrate with any other code.
.NET framework components
• Two basic components
– Class libraries
– CLR
• Other components
– Common Type System (CTS)
– Common Language Specification (CLS)
• The .NET Framework consists of:
– The Common Language Specification (CLS)
It contains guidelines, that language should follow so that they can
communicate with other .NET languages. It is also responsible for Type
matching.
– The Framework Base Class Libraries (BCL)
A consistent, object-oriented library of prepackaged functionality and
Applications.
– The Common Language Runtime (CLR)
A language-neutral development & execution environment that
provides common runtime for application execution .
40
.NET framework (contd..)
• Made of CLR and class
libraries called Framework
Class Library(FCL)
• The .NET Framework sits on
top of the Windows
platform - provides its own
set of services
Common Language Specification
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

42
Common Language Runtime (CLR)
• Provides services needed for executing
application – developed using any .NET
language
• Why any???
Common Language Runtime (CLR)
• CLR ensures:
– A common runtime environment for all .NET languages
– Uses Common Type System (strict-type & code-verification)
– Memory allocation and garbage collection
– Intermediate Language (IL) to native code compiler. Which Compiles MSIL
code into native executable code
– Security and interoperability of the code with other languages
• Over 36 languages supported today
– C#, VB, Jscript, Visual C++ from Microsoft
– Perl, Python, Smalltalk, Cobol, Haskell, Mercury, Eiffel, Oberon, Oz, Pascal, APL, CAML, Scheme, etc.

44
Common Language Runtime

• Code compiled into CLR’s intermediate language


- MSIL
• When running, program IL code - converted to
binary code by compiler within CLR
• Code that executes inside the CLR is called
managed code
CLR
Execution in CLR
Source VB C# C++
code
Compiler Compiler Compiler
Managed Assembly Assembly Assembly
code IL Code IL Code IL Code

Common Language Runtime


JIT Compiler

Native Code

Operating System Services


47
CLR
• CLR
– Processes
– Manages
– Executes code

• The compiled code to be run in the CLR is called


Portable executable code(PE) and is an .EXE or .DLL file
Goals of CLR
• Simpler, faster deployment

• Automatic handling of system-level tasks such as memory

management and process communication

• Simpler safer deployment

• Scalability

• Multiple Language Integration and support


Manifest
• One of the PEs include portion of MSIL called manifest.
• The manifest contains information about
• All the files in the assembly
• All classes in the assembly
• All datatypes in the assembly
• How to use the assembly
• When the CLR loads an assembly for use, only the manifest is
compiled into memory.
Just In Time compiling

• Methods of data types are compiled and cached in


memory only when needed
Executing a Managed Application
At execution time the IL and
Metadata are JIT compiled
SomeSource.exe

Metadata Running Process’ Memory

IL
JIT Compiler

Native
META DATA: Machine Language
10010100 10110000 10000000 10111010
Collected 11011011 11010111 11000010 01110110
information that
describes an
application
The CPU executes the JIT-
compiled machine code directly
Garbage collector

• When the application needs to have memory freed up , a


component of the CLR called Garbage collector performs its
work
• The GC tracks references to objects throughout the
applications’ life and only destroys objects that are no longer
used
CTS
• Refers Common Type System
• This defines a standard set of data types and specifies the rules for
creating new data types.
• These data types are used to write managed code.
CLS
• Refers Common Language Specification.
• Another subset of CLR which guarantees interoperability.
Class library
• Have classes – needed for developing
• Eg:
– ASP.NET classes – developing web applications
– Window Form Classes- windows applications
• Collection of similar classes into groups – namespaces
• Eg
– System.web- used to create ASP.NET web applications
– System.Data- classes used to access data
.NET framework- class library
• Large pre-written code that all applications created with
different code are built on
In short
• Every .NET language is built on the CLR
• All .NET languages share a common set of class libraries-
Used to do everything from displaying a Windows message
box to retrieving a file from the Internet.
.NET Framework

ASP.NET Windows Forms

Web Services Web Forms Controls Drawing

ASP.NET Application Services Windows Application Services

.NET Framework Base Classes


XML Threading IO
ADO.NET
Component Model Security Diagnostics Etc.

Common Language Runtime

Memory Management Common Type System Lifecycle Monitoring

Defines the data type used by


all .NET languages
From Source Code to Managed .exe
SomeSource.vb

VB Compiler

SomeSources.exe
Metadata

A Managed
Application IL
Cross Language Support
• .NET Framework supports many languages
– Any compiler can be modified to emit managed executables
• IL and metadata
– Languages that target the .NET Framework
– C#, Visual Basic, C++, Java, PERL, COBOL, SmallTalk
• Regardless of source language, all managed code can
– Use the same tools
– Use the same reusable components
• Take advantage of features of the CLR
• Developers use their language of choice
• can use the .NET Framework to develop the following types of applications and services:
• Console applications. See Building Console Applications.
• Windows GUI applications (Windows Forms). See Windows Forms.
• Windows Presentation Foundation (WPF) applications. See Windows Presentation
Foundation.
• ASP.NET applications. See Web Applications with ASP.NET.
• Windows services. See Introduction to Windows Service Applications.
• Service-oriented applications using Windows Communication Foundation (WCF).
See Service-Oriented Applications with WCF.
• Workflow-enabled applications using Windows Workflow Foundation (WF).
See Building Workflows in the .NET Framework.

You might also like