Introduction
Introduction
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
Native Code
• Scalability
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
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.