Upload
harold-pope
View
216
Download
1
Embed Size (px)
Citation preview
Microsoft .NET Framework Microsoft .NET Framework OverviewOverview
Abidi MahmoudAbidi Mahmoud
Seminarium onComponent-based Software Engineering
.NET Enterprise Vision
SchedulingAuthentication
Notification
ERP & Billing
Customer Operations Sales Supply Engineering
Customer
Service
Plant
Operations
UsersAny device,Any place,Any time
Roles/ExperiencesGet the right infoTo the right userAt the right time
XML Web ServicesIntegrate and orchestrate business applications and processes
Back OfficeHeterogeneous application and server infrastructure
What is .NET?What is .NET? A generic term for the MS visionA generic term for the MS vision
– The successor to WinDNAThe successor to WinDNA– Sometimes applied to product namesSometimes applied to product names
» Such as Such as Windows .NET ServerWindows .NET Server
A specific software frameworkA specific software framework– Includes a common runtimeIncludes a common runtime
» Common across OS and dev languageCommon across OS and dev language
– Includes baseline dev tools in an SDKIncludes baseline dev tools in an SDK– Includes powerful dev environmentIncludes powerful dev environment
» Visual Studio .NET Visual Studio .NET
.NET Framework.NET FrameworkStandard programming platformStandard programming platform
Common programming language Common programming language – C# “C Sharp”C# “C Sharp”– Standardized as ECMA-334Standardized as ECMA-334– Similar to Java (simplified C++)Similar to Java (simplified C++)
Common Language Infrastructure (CLI)Common Language Infrastructure (CLI)– Standardized as ECMA-335Standardized as ECMA-335– Defines classes, types, and techniquesDefines classes, types, and techniques– Internationalization (I18N) supportInternationalization (I18N) support
The structure of the .NET FrameworkThe structure of the .NET Framework
VBVB
ASP.NET
ADO.NET and XML
Common language specification (CLS)
Common language runtime (CLR)
COM+ servicesCOM+ services
.NET Framework classes.NET Framework classes
WindowsWindows
J#...J#...C#
Web FormsWeb FormsXML Web servicesXML Web services Windows Windows FormsForms
System servicesWin32 API and COM+ services
The structure of the .NET FrameworkThe structure of the .NET Framework
VBVB
ASP.NET
ADO.NET and XML
Common language specification (CLS)
Common Language Runtime (CLR)
COM+ servicesCOM+ services
.NET Framework classes.NET Framework classes
WindowsWindows
J#...J#...C#C#
Web FormsWeb FormsXML Web servicesXML Web services Windows Windows FormsForms
Microsoft implimentation of CLI and support for COM and
platform interoperation
What is the CLR?What is the CLR? CLR = Common Language RuntimeCLR = Common Language Runtime
– Microsoft’s implementation of CLI (ECMA Microsoft’s implementation of CLI (ECMA 335)335)»For Windows environmentsFor Windows environments
– Plus extensions for WindowsPlus extensions for Windows»Wintel PC, Wintel server, WinCE, Wintel PC, Wintel server, WinCE,
WinXPE, …WinXPE, …– Most extensions are in the class libraryMost extensions are in the class library
»CLI-compliant code runs on CLRCLI-compliant code runs on CLR
What is the CLI?What is the CLI? CLI = Common Language InfrastructureCLI = Common Language Infrastructure
– Language-neutral platformLanguage-neutral platform
– Provides a specification for executable code and the Provides a specification for executable code and the execution environment in which it runsexecution environment in which it runs
– Executable code is presented to the VES as Executable code is presented to the VES as modules.modules.
– CLI comprise the specification of :CLI comprise the specification of :» Execution engine (loader,JIT,garbage- collecting)Execution engine (loader,JIT,garbage- collecting)
» Common Type System (CTS)Common Type System (CTS)
» Common Language Specification (CLS)Common Language Specification (CLS)
Common Type System (CTS)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 Common Language Specification (CLS)(CLS)
The CLS is a set of rules that apply to generated assemblies.
The CLS is an agreement between language The CLS is an agreement between language designers and framework (that is, class library) designers and framework (that is, class library) designers.designers.
The CLS specifies a subset of the CTS and a The CLS specifies a subset of the CTS and a set of usage conventions.set of usage conventions.
For more info…For more info…– http://http://msdnmsdn..microsoftmicrosoft.com/net/.com/net/ecmaecma– http://www.http://www.ecmaecma..chch//
CLR FeaturesCLR Features All code is compiled, not interpretedAll code is compiled, not interpreted
– AssembliesAssemblies are deployed in intermediate language (IL, are deployed in intermediate language (IL, also called CIL or MSIL)also called CIL or MSIL)
– Converted to native machine code at run time (via JIT Converted to native machine code at run time (via JIT compiler)compiler)
Static code managementStatic code management– Versioning, localizing, and signingVersioning, localizing, and signing– Configurable assembly resolverConfigurable assembly resolver– Global assembly cache (GAC)Global assembly cache (GAC)
Dynamic code managementDynamic code management– Memory allocation with garbage collectionMemory allocation with garbage collection– Lifecycle management via reference trackingLifecycle management via reference tracking– Thread poolingThread pooling
CLR FeaturesCLR Features Fine-grained code access securityFine-grained code access security
– Augments OS securityAugments OS security– Ensures that code only performs operations Ensures that code only performs operations
allowed by policies set by user or administratorallowed by policies set by user or administrator– Based on code source, publisher signature, and Based on code source, publisher signature, and
other evidenceother evidence Flexible remotingFlexible remoting
– Includes XML/SOAP and binaryIncludes XML/SOAP and binary– Remoting model is easily extendedRemoting model is easily extended– Integrates with web servicesIntegrates with web services
CLR InternalsCLR Internals
Class LoaderClass Loader
IL to NativeIL to NativeCompilersCompilers
CodeCodeManagerManager
GarbageGarbageCollectorCollector
Security ServicesSecurity Services Debug ServicesDebug Services
Type CheckerType Checker Exception ManagerException Manager
Thread ManagerThread Manager COM MarshalerCOM Marshaler
Base Class LibraryBase Class Library
Assemblies(Assemblies(CLI deployment unitsCLI deployment units)) Set of files in a derectory Set of files in a derectory
– It can be single or multi fileIt can be single or multi file
Assemblies are composed ofAssemblies are composed of– Manifest Manifest
» Metadata that describes the assembliesMetadata that describes the assemblies
– Metada Metada » Machine-readable information about a resourceMachine-readable information about a resource
» In .NET metadata includes type definition, version information, In .NET metadata includes type definition, version information, external assemby referencesexternal assemby references
– Code IL Code IL » Code that CLR executes at runtimeCode that CLR executes at runtime
Global Assembly CacheGlobal Assembly Cache GAC = database of shared assembliesGAC = database of shared assemblies Each assembly must have strong nameEach assembly must have strong name
– Similar to GUID, but much more detailedSimilar to GUID, but much more detailed– Includes text name, version, culture, digital Includes text name, version, culture, digital
signature, and public keysignature, and public key– Keys created by SN (strong name) utilityKeys created by SN (strong name) utility– Nobody can use your names because they are based Nobody can use your names because they are based
on your private keyon your private key GAC assemblies can only refer to other strong-GAC assemblies can only refer to other strong-
named assembliesnamed assemblies
CLR and Classic RuntimesCLR and Classic Runtimes
Windows NT 4 Windows 2000 .NET CLR VB6
Your code C++ and MFC
Any .NET language
MSVBVM60.DLL Language layer MFC40.DLL
MFCOLE.DLL
Context layer MTS
MTXEX.DLL COM+
OLE32.DLL OLEAUT32.DLL
Component loader COM
OLE32.DLL OLEAUT32.DLL
COM+ OLE32.DLL
OLEAUT32.DLL
CLR MSCOREE.DLL MSCORLIB.DLL With side-by-side
execution to support multiple versions
ExecutionExecution
CodeCode
MetadataMetadata
Compilation & ExecutionCompilation & Execution
CompilationCompilation
Before Before installation or installation or the first time the first time
each method is each method is calledcalled
JIT JIT CompilerCompiler
NativeNativeCodeCode
Source Source CodeCode
Language Language CompilerCompiler
AssemblyUnit of deployment,
similar to DLL or EXE with added metadata
Saved in cacheAn assembly can also
be pre-compiled as part of deployment
The structure of the .NET FrameworkThe structure of the .NET Framework
VBVB
ASP.NET
ADO.NET and XML
Common language specification (CLS)
Common Language Runtime (CLR)
COM+ servicesCOM+ services
.NET Framework classes.NET Framework classes
WindowsWindows
J#...J#... Provide classes that can be called from
any .NET-enabled PLC#C#
Web FormsWeb FormsXML Web servicesXML Web services Windows Windows FormsForms
Frameworks make use of sealed classes(do not permit any subclassing)
Framework FoundationFramework Foundation
System
System.Data System.Xml
System.Web
Globalization
Text
Security
Collections
Resources
Reflection
Net
IO
Threading
Diagnostics
ServiceProcess
Configuration
Design
Data (Dataset)
SQLTypes
SQL
XPath
XSLT
RuntimeInteropServices
Remoting
Serialization
Serialization
Configuration SessionState
Caching Security
ServicesDescription
Discovery
Protocols
UIHtmlControls
WebControls
System.Drawing
Imaging
Drawing2D
Text
Printing
System.WinForms
Design ComponentModel
Reader/Writers
DOM
Drawing
Framework support (Framework support (configuration,globalization, and managementconfiguration,globalization, and management))
System
System.Data System.Xml
System.Web
Globalization
Text
Security
Collections
Resources
Reflection
Net
IO
Threading
Diagnostics
ServiceProcess
Configuration
Design
Data (Dataset)
SQLTypes
SQL
XPath
XSLT
RuntimeInteropServices
Remoting
Serialization
Serialization
Configuration SessionState
Caching Security
ServicesDescription
Discovery
Protocols
UIHtmlControls
WebControls
System.Drawing
Imaging
Drawing2D
Text
Printing
System.WinForms
Design ComponentModel
Reader/Writers
DOM
Drawing
Framework support (Framework support (platform acces and COM interoperationplatform acces and COM interoperation))
System
System.Data System.Xml
System.Web
Globalization
Text
Security
Collections
Resources
Reflection
Net
IO
Threading
Diagnostics
ServiceProcess
Configuration
Design
Data (Dataset)
SQLTypes
SQL
XPath
XSLT
RuntimeInteropServices
Remoting
Serialization
Serialization
Configuration SessionState
Caching Security
ServicesDescription
Discovery
Protocols
UIHtmlControls
WebControls
System.Drawing
Imaging
Drawing2D
Text
Printing
System.WinForms
Design ComponentModel
Reader/Writers
DOM
Drawing
Framework support (Framework support (I/O, messaging, remoting, and serializationI/O, messaging, remoting, and serialization))
System
System.Data System.Xml
System.Web
Globalization
Text
Security
Collections
Resources
Reflection
Net
IO
Threading
Diagnostics
ServiceProcess
Configuration
Design
Data (Dataset)
SQLTypes
SQL
XPath
XSLT
RuntimeInteropServices
Remoting
Serialization
Serialization
Configuration SessionState
Caching Security
ServicesDescription
Discovery
Protocols
UIHtmlControls
WebControls
System.Drawing
Imaging
Drawing2D
Text
Printing
System.WinForms
Design ComponentModel
Reader/Writers
DOM
Drawing
Framework support (Framework support (debugging, compilation, and code generationdebugging, compilation, and code generation))
System
System.Data System.Xml
System.Web
Globalization
Text
Security
Collections
Resources
Reflection
Net
IO
Threading
Diagnostics
ServiceProcess
Configuration
Design
Data (Dataset)
SQLTypes
SQL
XPath
XSLT
RuntimeInteropServices
Remoting
Serialization
Serialization
Configuration SessionState
Caching Security
ServicesDescription
Discovery
Protocols
UIHtmlControls
WebControls
System.Drawing
Imaging
Drawing2D
Text
Printing
System.WinForms
Design ComponentModel
Reader/Writers
DOM
Drawing
Framework support (Framework support ( web protocol, web sever acces,and XML standards,…)web protocol, web sever acces,and XML standards,…)
System
System.Data System.Xml
System.Web
Globalization
Text
Security
Collections
Resources
Reflection
Net
IO
Threading
Diagnostics
ServiceProcess
Configuration
Design
Data (Dataset)
SQLTypes
SQL
XPath
XSLT
RuntimeInteropServices
Remoting
Serialization
Serialization
Configuration SessionState
Caching Security
ServicesDescription
Discovery
Protocols
UIHtmlControls
WebControls
System.Drawing
Imaging
Drawing2D
Text
Printing
System.Windows.Forms
Design ComponentModel
Reader/Writers
Run Time
DOM
Drawing (subset)
Framework support (Framework support (component classes, web server support… component classes, web server support… ))
System
System.Data System.Xml
System.Web
Globalization
Text
Security
Collections
Resources
Reflection
Net
IO
Threading
Diagnostics
ServiceProcess
Configuration
Design
Data (Dataset)
SQLTypes
SQL
XPath
XSLT
RuntimeInteropServices
Remoting
Serialization
Serialization
Configuration SessionState
Caching Security
ServicesDescription
Discovery
Protocols
UIHtmlControls
WebControls
System.Drawing
Imaging
Drawing2D
Text
Printing
System.Windows.Forms
Design ComponentModel
Reader/Writers
Run Time
DOM
Drawing (subset)
The structure of the .NET FrameworkThe structure of the .NET Framework
VBVB
ASP.NET
ADO.NET and XML
Common language specification (CLS)
Common Language Runtime (CLR)
COM+ servicesCOM+ services
.NET Framework classes.NET Framework classes
WindowsWindows
J#...J#... ADO.NET is a set of classes that provide
data access support for the .NET Framework
C#C#
Web FormsWeb FormsXML Web servicesXML Web services Windows Windows FormsForms
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 FrameworkThe structure of the .NET Framework
VBVB
ASP.NET
ADO.NET and XML
Common language specification (CLS)
Common Language Runtime (CLR)
COM+ servicesCOM+ services
.NET Framework classes.NET Framework classes
WindowsWindows
J#...J#...C#
Web FormsWeb FormsXML Web servicesXML Web services Windows FormsWindows Forms
ASP.NETIncluding Web Forms
AndXML Web services
Traditional client application that use
windows Forms
The structure of the .NET FrameworkThe structure of the .NET Framework
VBVB
ASP.NET
ADO.NET and XML
Common language specification (CLS)
Common Language Runtime (CLR)
COM+ servicesCOM+ services
.NET Framework classes.NET Framework classes
WindowsWindows
J#...J#...C#C#
Web FormsWeb FormsXML Web servicesXML Web services Windows Windows FormsForms
CLS set of rules that a CLS-compliant
language needs to follow
Language that follow the CLS
C#, VB, J# …
Classic MS languagesClassic MS languages
VB – gains many OO featuresVB – gains many OO features VC++ – gains managed code featuresVC++ – gains managed code features VJ# – replaces VJ++ (not J2EE)VJ# – replaces VJ++ (not J2EE) C# – C# – new languagenew language
C# (C Sharp) OverviewC# (C Sharp) Overview
C# is a new language, crafted specifically to work C# is a new language, crafted specifically to work well within the .NET Frameworkwell within the .NET Framework
C# do not supportC# do not support – TemplatesTemplates– Multiple InheritanceMultiple Inheritance– Global FunctionsGlobal Functions– Preprocessor MacrosPreprocessor Macros
C# support C# support – Operator OverloadingOperator Overloading– ……
SummarySummary .NET Framework provides….NET Framework provides…
– Common platform for all .NET languagesCommon platform for all .NET languages– Sophisticated code managementSophisticated code management– Fine-grained securityFine-grained security
.NET Framework fixes….NET Framework fixes…– Object life-cycle problems, especially COMObject life-cycle problems, especially COM– Weak support for enterprise featuresWeak support for enterprise features
» COM+, WMI, MSMQ, …COM+, WMI, MSMQ, …
– DLL hell and other deployment problemsDLL hell and other deployment problems
??????