VB'NET CLR - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

VB'NET CLR

Description:

The .NET Common Language Runtime (CLR) is the language runtime that all of the. ... Modules are some of the files that make up an assembly (EXEs and DLLs) ... – PowerPoint PPT presentation

Number of Views:55
Avg rating:3.0/5.0
Slides: 14
Provided by: richardv9
Category:
Tags: clr | net | exes

less

Transcript and Presenter's Notes

Title: VB'NET CLR


1
VB.NET CLR
  • Richard Vantrease

2
Introduction
  • The .NET Common Language Runtime (CLR) is the
    language runtime that all of the .NET languages
    use. VB used to require its own runtime files.
  • msvbvm60.dll was the main runtime file for VB 6.0.

3
Vocabulary
  • Assemblies (DLL or EXE)
  • Manifest
  • Modules
  • Types
  • .NET Metadata
  • Attributes
  • Deployment
  • Managed Code
  • Finalize Method
  • Garbage Collector
  • Managed Heap

4
Assemblies
  • An assembly is the primary unit of deployment for
    a .NET application.
  • Assemblies contain modules, a manifest and
    resource files.
  • Assemblies can only have one manifest.

5
Modules
  • Modules are some of the files that make up an
    assembly (EXEs and DLLs).
  • Modules contain types (similar to classes in
    VB6), metadata, and optionally the assembly
    manifest.
  • Types are made up of Fields, Methods and
    Properties.

6
.NET Assembly Manifest
  • Manifest is stored in an EXE, DLL or a standalone
    portable execution (PE) file.
  • The manifest contains assembly metadata.
  • The assembly manifest
  • Lists files that make up the assembly
  • Maps location of types and resources
  • Enumerates other assembly dependencies
  • Self describes the assembly

7
Deployment
  • Deployment of a VB.NET assembly is much easier
    than deploying a VB6 application.
  • VB.NET assemblies are self describing and
    therefore do not need to be registered. The .NET
    framework searches for referenced assemblies
    automatically.
  • .NET also supports side by side execution (use of
    different versions of the same component).

8
Managed Code
  • Managed code is any code that executes in the
    CLR.
  • Code which is not in the .NET framework and does
    not use the CLR is un-managed code.

9
Garbage Collector
  • The garbage collector (GC) periodically goes
    through all the objects in use by the CLR and
    eliminates or destroys the ones that no longer
    are in use.
  • The GC, not the programmer, determines when an
    object is destroyed.
  • The GC uses nondeterministic finalization.

10
Finalize Method
  • Object.Finalize is the method that the GC calls
    immediately before collecting and destroying the
    object.
  • Sometimes it is necessary to override the
    finalize method in order to free up expensive
    resources or to more closely control the time
    when object clean-up occurs.

11
Overriding The Finalize Method
  • Protected Overrides Sub Finalize()
  • Cleanup code goes here
  • End Sub
  • Suppress normal finalize call
  • GC.SuppressFanalize(Me)

12
Managed Heap
  • The CLR uses the GC to manage the heap.
  • The heap is where objects are created in memory.
  • The .NET CLR uses a managed heap which means it
    keeps track of the objects allocated in the heap.

13
Heap Optimizations
  • Objects that are allocated on the heap are
    assigned generations (0 2).
  • Each time the GC runs if it does not collect an
    object, the objects generation is incremented.
  • The GC tries to collect objects with the lowest
    generation numbers first.
  • When the GC is done collecting objects it
    compacts the heap so it does not become
    fragmented.
Write a Comment
User Comments (0)
About PowerShow.com