What is .NET?

Download Report

Transcript What is .NET?

VPMP
POLYTECHNIC,GANDHINAGAR
Introduction to .NET and .NET
Framework
Prepared By:Shweta Patel
(Lecturers - Computer Department)
Topics Covered
In This Presentation
1.1 What is .NET?
1.2 NET Framework
1.2.1 Common Language Runtime (CLR)
1.2.2 Common Type System (CTS)
1.2.3 Managed & Unmanaged Code
1.2.3 Common Language Specification (CLS)
1.3 The .NET Framework Class Library
1.3.1 Namespaces
1.3.2 Assemblies
What is Microsoft .NET?



Microsoft .NET (pronounced “dot net”) is a software
component that runs on the Windows Operating
System. It provides tools and libraries that enable
developers to create Windows software much faster
and easier.
.NET is a software framework that includes
everything required for developing software for web
services.
It integrates presentation technologies, component
tech-neologies and data technologies on a single
platform so as enable users to develop internet
application as easily as they do on desktop system.
What is Microsoft .NET?



.NET benefits end-users by providing applications of
higher capability, quality and security.
.NET is the Microsoft’s Web services strategy to
connect information, people, systems, and devices
through software.
.NET is a new framework for developing web-based
and windows-based applications within the Microsoft
environment.
Advantages of .NET









Object-oriented programming
Good design
Language independence
Better support for dynamic web pages
Efficient data Access
Code sharing
Improved security
Zero impact installation
Support for web services
What is Microsoft .NET?
.NET Application
.NET Framework
Operating System + Hardware
Microsoft .NET components:
Microsoft .NET consists of four major
components:
 Common Language Specification (CLS)
 Framework Class Library (FCL)
 Common Language Runtime (CLR)
 .NET Tools
.NET Framework
VB
C++
C#
JScript
…
ASP.NET: Web Services
and Web Forms
Windows
Forms
ADO.NET: Data and XML
Base Class Library
Common Language Runtime
Visual Studio.NET
Common Language Specification
Common Language Runtime



The Common Language Runtime (CLR) is a core
component of .NET
In the CLR, code is expressed in a form of byte code
called the Common Intermediate Language (CIL,
previously known as MSIL—Microsoft Intermediate
Language).
Developers using the CLR write code in a language such
as C# or VB.
Common Language Runtime



At compile time, a .NET compiler converts such code
into CIL code.
At runtime, the CLR's Just-In-Time compiler converts the
CIL code into code native to the operating system.
The Common Language Runtime (CLR) provides
various Just-In-Time compilers (JIT) and each works on
a different architecture depending on Operating System.
Common Language Runtime
CLR: Execution Model
Source
code
Managed
code
VB
C#
Compiler
Compiler
Compiler
Assembly
IL Code
Assembly
IL Code
Assembly
IL Code
C++
Common Language Runtime
JIT Compiler
Native Code
Operating System Services
Unmanaged
Component
Common Type System


Common Type System (CTS) describes a set of types
that can use different .NET languages have in common,
which ensure that objects written in different languages
can interact with each other.
For example, ‘int’ in C# and ‘Integer’ in VB both refer to
common predefined data type ‘Int32’ in MSIL (or CIL).
Managed & Unmanaged Code



Managed Code in Microsoft .NET Framework, is the
code that has executed by the Common Language
Runtime (CLR) environment.
On the other hand, Unmanaged Code is directly
executed by the computer's CPU.
Data types, error-handling mechanisms, creation and
destruction rules, and design guidelines vary between
managed and unmanaged object models.
Managed & Unmanaged Code



The Managed Code running in a Common Language
Runtime (CLR) cannot be accessed outside the runtime
environment which makes the programs more isolated
& the computers more secure.
On the other hand, Unmanaged Code can bypass the
.NET Framework and make direct calls to the Operating
System presenting a major security risk.
Hence, Managed code is designed to be more reliable
and robust than Unmanaged code.
Common Language Specification


Common Language Specification (CLS) is a set of basic
language features that .NET Languages needed to
develop Applications and Services, which are compatible
with the .NET Framework.
Common Language Specification (CLS) ensures
complete interoperability among applications, regardless
of the language used to create the application by the use
of Common Type System (CTS).
.NET Framework Class Library


The .NET Framework Class Library (FCL) provides the
core functionality of .NET Framework Architecture.
The .NET Framework Class Library (FCL) includes a
huge collection of reusable classes, interfaces and value
types that expedite and optimize the development
process and provide access to system functionality.
.NET FCL - Namespaces




.NET FCL is organized in a hierarchical tree structure
and it is divided into Namespaces. Namespaces is a
logical grouping of types for the purpose of identification.
The Classes are accessed by namespaces, which reside
within Assemblies. The System Namespace is the root
for all types in the .NET Framework.
Whenever we want to refer to a sub-class of a class, or
class of a particular namespace, we refer it by
‘NamespaceName.ClassName.Sub-className’.
For e.g., to use ‘Data’ class of ‘System’ namespace, we
write ‘System.Data’; and to use ‘SQL’ sub-class of ‘Data’,
we write ‘System.Data.SQL’.
.NET Framework Namespaces
System.Web
Services
Description
UI
HtmlControls
Discovery
WebControls
System.WinForms
Design
Protocols
ComponentModel
System.Drawing
Caching
Security
Drawing2D
Printing
Configuration
SessionState
Imaging
Text
System.Data
System.Xml
ADO
SQL
XSLT
Design
SQLTypes
XPath
Serialization
System
Collections
IO
Security
Runtime
InteropServices
Configuration
Net
ServiceProcess
Diagnostics
Reflection
Text
Remoting
Globalization
Resources
Threading
Serialization
.NET FCL - Assemblies



Microsoft .NET Assembly is a logical unit of code, it
contains code that the CLR executes.
During the compile time, Metadata is created with MSIL
and stored in a file called a Manifest. Both Metadata and
MSIL are together wrapped in a Portable Executable
(PE) file.
The information contained by the Manifest is called
Assembly Manifest. It contains information about the
members, types, references and all the other data that
the runtime needs for execution.
.NET FCL - Assemblies



Every Assembly that is created contains one or more
program files and a Manifest. There are two types of
program files: Process Assemblies (EXE) and Library
Assemblies (DLL).
A Private Assembly is used only by a single application
and usually stored in that application's install directory. A
Shared Assembly is one that can be referenced by more
than one application.
If multiple applications need to access an Assembly, we
should add the Assembly to the Global Assembly Cache
(GAC).
Metadata in Assembly
Type Descriptions
Classes
Base classes
Implemented interfaces
Data members
Methods
Assembly Description
Name
Version
Culture
Other assemblies
Security Permissions
Exported Types
Code Compilation & Execution
Compilation
Source
Code
Language
Compiler
Execution
Native
Code
JIT
Compiler
Code
MSIL
Metadata
Also called
Assembly
(.EXE or
.DLL file)
Before installation
or the first time
each method is
called