Microsoft .NET Overview

Seminarium on
Component-based
Software Engineering
Microsoft .NET Framework
Overview
Abidi Mahmoud
.NET Enterprise Vision
Users
Any device,
Any place,
Any time
Roles/Experiences
Get the right info
To the right user
At the right time
Customer
Operations
Sales
Supply
Engineering
XML Web Services
Scheduling
Authentication
Notification
Integrate and
orchestrate business
applications and
processes
Back Office
Heterogeneous application
and server infrastructure
ERP & Billing
Customer
Plant
Service
Operations
What is .NET?

A generic term for the MS vision
– The successor to WinDNA
– Sometimes applied to product names
» Such as Windows .NET Server

A specific software framework
– Includes a common runtime
» Common across OS and dev language
– Includes baseline dev tools in an SDK
– Includes powerful dev environment
» Visual Studio .NET
.NET Framework
Standard programming platform

Common programming language
– C# “C Sharp”
– Standardized as ECMA-334
– Similar to Java (simplified C++)

Common Language Infrastructure (CLI)
– Standardized as ECMA-335
– Defines classes, types, and techniques
– Internationalization (I18N) support
The structure of the .NET Framework
VB
C#
J#...
Common language specification (CLS)
ASP.NET
XML Web services
Web Forms
Windows
Forms
ADO.NET and XML
.NET Framework classes
Common language runtime (CLR)
Windows
COM+ services
System services
Win32 API and COM+ services
The structure of the .NET Framework
VB
C#
J#...
Common language specification (CLS)
ASP.NET
XML Web services
Web Forms
Windows
Forms
ADO.NET and XML
.NET Framework classes
Common Language Runtime (CLR)
Windows
COM+ services
Microsoft implimentation of
CLI and support for COM and platform
interoperation
What is the CLR?

CLR = Common Language Runtime
– Microsoft’s implementation of CLI (ECMA
335)
»For Windows environments
– Plus extensions for Windows
»Wintel PC, Wintel server, WinCE,
WinXPE, …
– Most extensions are in the class library
»CLI-compliant code runs on CLR
What is the CLI?

CLI = Common Language Infrastructure
– Language-neutral platform
– Provides a specification for executable code and the
execution environment in which it runs
– Executable code is presented to the VES as
modules.
– CLI comprise the specification of :
» Execution engine (loader,JIT,garbage- collecting)
» Common Type System (CTS)
» Common Language Specification (CLS)
Common Type System (CTS)


Types describe values and specify a contract that all
values of that type shall support.
CTS supports (OOP) as well as functional and
procedural PL
– Values are simple bit patterns for things like
integers and floats…;
– Objects Each object is self-typing, that is, its type
is explicitly stored in its representation.
Common Language Specification
(CLS)
The CLS is a set of rules that apply to
generated assemblies.
 The CLS is an agreement between language
designers and framework (that is, class library)
designers.
 The CLS specifies a subset of the CTS and a
set of usage conventions.


For more info…
– http://msdn.microsoft.com/net/ecma
– http://www.ecma.ch/
CLR Features

All code is compiled, not interpreted
– Assemblies are deployed in intermediate language (IL,
also called CIL or MSIL)
– Converted to native machine code at run time (via JIT
compiler)

Static code management
– Versioning, localizing, and signing
– Configurable assembly resolver
– Global assembly cache (GAC)

Dynamic code management
– Memory allocation with garbage collection
– Lifecycle management via reference tracking
– Thread pooling
CLR Features

Fine-grained code access security
– Augments OS security
– Ensures that code only performs operations
allowed by policies set by user or administrator
– Based on code source, publisher signature, and
other evidence

Flexible remoting
– Includes XML/SOAP and binary
– Remoting model is easily extended
– Integrates with web services
CLR Internals
Base Class Library
Thread Manager
COM Marshaler
Type Checker
Exception Manager
Security Services
Debug Services
IL to Native
Compilers
Code
Manager
Class Loader
Garbage
Collector
Assemblies(CLI deployment units)

Set of files in a derectory
– It can be single or multi file

Assemblies are composed of
– Manifest
» Metadata that describes the assemblies
– Metada
» Machine-readable information about a resource
» In .NET metadata includes type definition, version information,
external assemby references
– Code IL
» Code that CLR executes at runtime
Global Assembly Cache
GAC = database of shared assemblies
 Each assembly must have strong name

– Similar to GUID, but much more detailed
– Includes text name, version, culture, digital
signature, and public key
– Keys created by SN (strong name) utility
– Nobody can use your names because they are based
on your private key

GAC assemblies can only refer to other strongnamed assemblies
CLR and Classic Runtimes
Windows NT 4
Windows 2000
VB6
C++ and MFC
Your code
.NET CLR
Any .NET language
MSVBVM60.DLL
MFC40.DLL
MFCOLE.DLL
Language layer
Context layer
Component loader
CLR
MTS
COM+
MTXEX.DLL
OLE32.DLL
OLEAUT32.DLL
COM
COM+
OLE32.DLL
OLEAUT32.DLL
OLE32.DLL
OLEAUT32.DLL
MSCOREE.DLL
MSCORLIB.DLL
With side-by-side
execution to support
multiple versions
Compilation & Execution
Assembly
Unit of deployment,
similar to DLL or EXE
with added metadata
Compilation
Source
Code
Language
Compiler
Saved in cache
An assembly can also be
pre-compiled as part of
deployment
Execution
Native
Code
JIT
Compiler
Code
Metadata
Before
installation or
the first time
each method is
called
The structure of the .NET Framework
VB
C#
J#...
Provide classes that can
be called from any .NETenabled PL
Common language specification (CLS)
ASP.NET
XML Web services
Web Forms
Windows
Forms
ADO.NET and XML
.NET Framework classes
Common Language Runtime (CLR)
Windows
COM+ services
Frameworks make use of
sealed classes(do not
permit any subclassing)
Framework Foundation
System.Web
System.WinForms
Services
Description
UI
HtmlControls
Discovery
WebControls
Protocols
Design
ComponentModel
System.Drawing
Drawing
Caching
Security
Drawing2D
Printing
Configuration
SessionState
Imaging
Text
System.Data
System.Xml
Data (Dataset)
SQL
XSLT
DOM
Serialization
Design
SQLTypes
XPath
Reader/Writers
System
Collections
IO
Configuration
Security
Net
ServiceProcess
Runtime
InteropServices
Text
Reflection
Diagnostics
Remoting
Globalization
Resources
Threading
Serialization
Framework support (configuration,globalization, and management)
System.Web
System.WinForms
Services
Description
UI
HtmlControls
Discovery
WebControls
Protocols
Design
ComponentModel
System.Drawing
Drawing
Caching
Security
Drawing2D
Printing
Configuration
SessionState
Imaging
Text
System.Data
System.Xml
Data (Dataset)
SQL
XSLT
DOM
Serialization
Design
SQLTypes
XPath
Reader/Writers
System
Collections
IO
Configuration
Security
Net
ServiceProcess
Runtime
InteropServices
Text
Reflection
Diagnostics
Remoting
Globalization
Resources
Threading
Serialization
Framework support (platform acces and COM interoperation)
System.Web
System.WinForms
Services
Description
UI
HtmlControls
Discovery
WebControls
Protocols
Design
ComponentModel
System.Drawing
Drawing
Caching
Security
Drawing2D
Printing
Configuration
SessionState
Imaging
Text
System.Data
System.Xml
Data (Dataset)
SQL
XSLT
DOM
Serialization
Design
SQLTypes
XPath
Reader/Writers
System
Collections
IO
Configuration
Security
Net
ServiceProcess
Runtime
InteropServices
Text
Reflection
Diagnostics
Remoting
Globalization
Resources
Threading
Serialization
Framework support (I/O, messaging, remoting, and serialization)
System.Web
System.WinForms
Services
Description
UI
HtmlControls
Discovery
WebControls
Protocols
Design
ComponentModel
System.Drawing
Drawing
Caching
Security
Drawing2D
Printing
Configuration
SessionState
Imaging
Text
System.Data
System.Xml
Data (Dataset)
SQL
XSLT
DOM
Serialization
Design
SQLTypes
XPath
Reader/Writers
System
Collections
IO
Configuration
Security
Net
ServiceProcess
Runtime
InteropServices
Text
Reflection
Diagnostics
Remoting
Globalization
Resources
Threading
Serialization
Framework support (debugging, compilation, and code generation)
System.Web
System.WinForms
Services
Description
UI
HtmlControls
Discovery
WebControls
Protocols
Design
ComponentModel
System.Drawing
Drawing
Caching
Security
Drawing2D
Printing
Configuration
SessionState
Imaging
Text
System.Data
System.Xml
Data (Dataset)
SQL
XSLT
DOM
Serialization
Design
SQLTypes
XPath
Reader/Writers
System
Collections
IO
Configuration
Security
Net
ServiceProcess
Runtime
InteropServices
Text
Reflection
Diagnostics
Remoting
Globalization
Resources
Threading
Serialization
Framework support ( web protocol, web sever acces,and XML standards,…)
System.Web
System.Windows.Forms
Services
Description
UI
HtmlControls
Discovery
WebControls
Protocols
Design
ComponentModel
Run Time
System.Drawing
Drawing (subset)
Caching
Security
Drawing2D
Printing
Configuration
SessionState
Imaging
Text
System.Data
System.Xml
Data (Dataset)
SQL
XSLT
DOM
Serialization
Design
SQLTypes
XPath
Reader/Writers
System
Collections
IO
Configuration
Security
Net
ServiceProcess
Runtime
InteropServices
Text
Reflection
Diagnostics
Remoting
Globalization
Resources
Threading
Serialization
Framework support (component classes, web server support… )
System.Web
System.Windows.Forms
Services
Description
UI
HtmlControls
Discovery
WebControls
Protocols
Design
ComponentModel
Run Time
System.Drawing
Drawing (subset)
Caching
Security
Drawing2D
Printing
Configuration
SessionState
Imaging
Text
System.Data
System.Xml
Data (Dataset)
SQL
XSLT
DOM
Serialization
Design
SQLTypes
XPath
Reader/Writers
System
Collections
IO
Configuration
Security
Net
ServiceProcess
Runtime
InteropServices
Text
Reflection
Diagnostics
Remoting
Globalization
Resources
Threading
Serialization
The structure of the .NET Framework
VB
C#
J#...
Common language specification (CLS)
ADO.NET is a set of
classes that provide data
access support for the
.NET Framework
ASP.NET
XML Web services
Web Forms
Windows
Forms
ADO.NET and XML
.NET Framework classes
Common Language Runtime (CLR)
Windows
COM+ services
ADO.NET is based on
ADO but is designed to
work with XML and to
work in a disconnected
environment
The structure of the .NET Framework
VB
C#
J#...
Common language specification (CLS)
ASP.NET
ASP.NET
Including Web Forms
And
XML Web services
XML Web services Web Forms Windows Forms
ADO.NET and XML
.NET Framework classes
Common Language Runtime (CLR)
Windows
COM+ services
Traditional client
application that use
windows Forms
The structure of the .NET Framework
VB
C#
J#...
Common language specification (CLS)
ASP.NET
XML Web services
Web Forms
Windows
Forms
ADO.NET and XML
CLS set of rules that a
CLS-compliant language
needs to follow
.NET Framework classes
Common Language Runtime (CLR)
Windows
COM+ services
Language that follow the
CLS
C#, VB, J# …
Classic MS languages




VB – gains many OO features
VC++ – gains managed code features
VJ# – replaces VJ++ (not J2EE)
C# – new language
C# (C Sharp) Overview


C# is a new language, crafted specifically to work
well within the .NET Framework
C# do not support
–
–
–
–

Templates
Multiple Inheritance
Global Functions
Preprocessor Macros
C# support
– Operator Overloading
– …
Summary

.NET Framework provides…
– Common platform for all .NET languages
– Sophisticated code management
– Fine-grained security

.NET Framework fixes…
– Object life-cycle problems, especially COM
– Weak support for enterprise features
» COM+, WMI, MSMQ, …
– DLL hell and other deployment problems
???