.NET Framework - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

.NET Framework

Description:

Designers. ECMA CLI. ECMA. Networking. SSCLI. Profiles and Libraries of ECMA-335 ... Logical collection of one or more modules (stored in physical files) ... – PowerPoint PPT presentation

Number of Views:174
Avg rating:3.0/5.0
Slides: 24
Provided by: marttilaih
Category:
Tags: net | framework

less

Transcript and Presenter's Notes

Title: .NET Framework


1
.NET Framework CLI
  • Sources
  • David Chappell Understanding .NET
  • David Stutz et al Shared Source CLI Essentials
  • ECMA-335

Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2003-2005
2
.NET Architecture
Source Understanding .NET David Chappell
Browser Apps
Web Services Apps
Local Apps
Other Apps
.NET Framework Class Library
ASP.NET
ADO.NET
Windows Forms
Enterprise Services
etc
Common Language Runtime (CLR)
Windows
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002
3
ECMA-335 CLI
  • Partition I Concepts and Architectures
  • Partition II Metadata Definition and
    Semantics
  • Partition III CIL Instruction Set
  • Partition IV Profiles and Libraries
  • Partition V Annexes
  • Annex C CIL Assembler Implementation
  • Annex D Class Library Design Guides
    (programming guidelines)
  • Naming Guidelines
  • Type Meber Usage Guidelines
  • Error Raising and Handling
  • Array Usage Guidelines
  • Operator Overloading Guidelines
  • Threading Design Guidelines
  • Annex E Portability Considerations

4
ECMA-335 CLI (Glossary ..)
  • CLI Common Language Infrastucture, Partition I
    p 21-
  • CLS Common Language Specification, Partition I
    p 24-
  • CTS Common Type System, Partition I p 27-
  • Metadata - Partition I p 56-, Partition II
  • VES Virtual Execution System, Partition I p 70-
  • CIL Common Intermadiate Language, Partition III
  • CAS Code Access Security
  • JIT Just-In-Time (compiler and verifyer)
  • GAC Global Assembly Cache
  • PE Microsoft Portable Executable (file format),
    Partition II p 154
  • COFF Common Object File Format
  • COR Component Object Runtime
  • PAL Platform Adaptation Layer
  • EIT Exception Information Tables
  • SHE Structured Exception Handling
  • GC Garbage Collector
  • TLS Thread Local Storage
  • (CLS Class Local Storage)

5
.NET Framework namespaces
Source Understanding .NET David Chappell
System
Windows
Data
Web
Int32, String, (CTS)
EnterpriseServices
XML
etc
Forms
Services
UI
XmlDocument,
ServicedComponent,
Connection, DataSet,
etc
etc
etc
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002
6
Namespaces in .NET Framework class library
FCS Partners
System.Web
System.Windows.Forms
Services
UI
Design
ComponentModel
HtmlControls
Description
Discovery
WebControls
System.Drawing
Protocols
Printing
Drawing2D
Security
Caching
Text
Imaging
SessionState
Configuration
System.Data
System.Xml
OleDb
SQLClient
XSL
Serialization
Common
SQLTypes
XPath
Schema
System
Collections
IO
Security
Runtime
Configuration
Net
ServiceProcess
InteropService
Diagnostics
Reflection
Text
Remoting
Globalization
Resources
Threading
Serialization
Notes by Helia / Martti Laiho, Tuomo Ketomäki,2002
7
SSCLI ECMA Additional features
SSCLI p 15
VS .NET
ECMA
SDK tools
CorDBG
ILAsm
ILDbDump
SN
ILDAsm
ECMA CLI
Common Language Infrastructure (CLI execution
engine, CLR)
Metainfo
Memory mgmt. (GC)
Domains Loaders
JIT compiler (CIL)
PEVerify
Stacks threads
Common Type System
Metadata mgmt
SSCLI
Platform Adaptation Layer (PAL)
Boot loader
Networking
Threads
Sync
Timers
Filesystem
Notes by Helia / Martti Laiho, Tuomo Ketomäki,2003
8
Profiles and Libraries of ECMA-335
Partition IV p 3
9
Common Type System (CTS)
Source Understanding .NET David Chappell
Object
Reference Types
Value Types
Class
Value Type
Interface
Byte
Int16
UInt16
Single
Array
Double
Int32
UInt32
Char
String
Enum
Int64
UInt64
Delegate
Decimal
Structure
etc
Boolean
etc
etc
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002
10
ECMA-335 Type System
11
CLR-based Application Domain
Source Understanding .NET David Chappell
Application Domain
Unit of deployment, versioning and security
Assembly

Class X

Class Y
Class Z
Method 1
Method 1
Method 1
ECMA-335 Partition II Metadata
Method 2
Method 2
Method 3
Method 3
Method 4
Metadata for classes X, Y, and Z
Stack
Heap
Common Language Runtime (CLR)
Loader
JIT Compiler
Carbage Collector
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002
12
ECMA-335 Machine State
ECMA-335
13
Assembly
  • Unit of deployment - used to package, load,
    distribute and for versioning of CLR modules
  • Logical collection of one or more modules (stored
    in physical files)
  • Contains in one module Manifest Assembly level
    metadata and internal directory of the modules
  • Can be signed gt Strong Name

Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2004
14
Assembly
Source SSCLI Essentials p 84
Manifest (Assembly metadata)
Type CIL
Type CIL
Assembly (namespace)
Type CIL
Type CIL
Type CIL
Type CIL
Files used
type imports ?
Type metadata
Type metadata
public type exports
Resources
Resources
Resources
Strings/BLOB
Strings/BLOB
. . .
Module File
Module File
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2003
15
Metadata
  • Compiler creates based on the code and
    attributesenables self describing objects for
    any .NET compilers
  • Identity
  • Assembly name
  • Version Major.Minor.Build.Revision
  • Culture (default neutral)
  • Publishers public key ( gt Strong Name )
  • Type definition
  • Classes, interfaces, structures, enums
  • Methods, propertys, fields, events
  • References to external types
  • Export/Import XML / COM tlb

(see Assemblyinfo.cs in Visual Studio .NET
projects)
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2004
16
Attributes
  • Bracket enclosed attributes embedded in C
    code can be used as
  • Compiler pragmas WebMethod, Conditional,
  • Framework built-ins Serializable,
  • Custom attributes
  • in front of classes, interfaces, structures,
    methods, fields,
  • or applied to the entire assembly
  • Compiler copies the built-in and custom
    attributes as metadata into the assembly
  • Used by Reflection

Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2004
17
Reflection
Source Understanding .NET David Chappell
A Standard Interface to an assemblys Metadata
- Static / Dynamic
Assembly
LoadFrom
GetModule
Module
GetType
Type class
Type interface
GetMethods
GetMethods
Methodinfo

Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002
18
CLIs sequential transformation and augmentation
of types
Source SSCLI Essentials p 258
Native code, data structure layout, GC
descriptions, helper stubs, tables for exception
handling
Memory usage, exception frames, stack
frames, security info, locks, hashes
Application domains, classes, method
tables, descriptions
Metadata, CIL, resources in assemblies
High-level component
Loaders
JIT compiler and verifier
Executive engine
Cooperating components
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2003
19
Elements of Object Instance
Source SSCLI Essentials p 118
Object reference
in execution engines address space
in GCs heap or threads stack
Sync block index
Object header
Instance data
locks hash values etc
SyncBlock table
bitflags spinlock
if gt 0
Sync record

Component reference
SyncBlock

Module
Interface map
GCDesc
MethodTable




ClassLoader
JMI thunk
Compiled method
vtable slots
Assembly


Prestub
Prestub pointer
MethodDesc
EEClass
Application domain


FieldDesc
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2003
20
.NET Remoting
Source Understanding .NET David Chappell
Application Domain 1
Application Domain 2
Client
Proxy for Object O
Object O
Channel
Channel
An assembly containing the remote objects
classes and/or interfaces must be available on
the clients machine. The CLR automatically
creates a proxy by using reflection (?) to access
the metadata of the remote object. Channel
TCP channel, HTTP/SOAP channel, or some built
custom channel.
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002
21
.NET Remoting Parameter Marshalling
Source Understanding .NET David Chappell
Application Domain 1
Application Domain 2
Object X (MBV)
Copy of X
Client
Object Y (MBR)
Proxy for Y
Proxy for Object O
Object O
Channel
Channel
- Marshal by Value (MBV) objects are copied when
passed across an application domain boundary. -
Marshal by Reference (MBR) objects have a proxy
created for them in the remote application domain
boundary
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002
22
.NET Remoting Remote Object Access Modes
Source Understanding .NET David Chappell
Application Domain 1
Application Domain 2
(stateless) Single-Call
Server- Activated
Singleton
Object
Client
Client-Activated
Client
Client
- For a singleton object accessible at a given
URL, there is never more than one instance of the
class active at any time.
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002
23
Enterprise Services Serviced Components
Source Understanding .NET David Chappell
Framework 1.1
Application Domain
COM Services - using wrappers
inherits ServicedComponent
Serviced Component X
Context Information for X
Serviced Component Y
Context Information for Y
CLR
  • Transactions
  • Just-in-time activation
  • Object pooling
  • Role-based authorization
  • etc

Call within managed code Call between managed and
unmanaged code
Notes by Helia / Martti Laiho, Tuomo Ketomäki,
2002
Write a Comment
User Comments (0)
About PowerShow.com