You are on page 1of 18

Introduction to the

Microsoft .NET Framework

Chris Wastchak
Student Ambassador to Microsoft

What is the .NET Framework • A new computing platform designed to simplify application development • A consistent object-oriented programming environment • A code-execution environment that: – Minimizes software deployment and versioning conflicts – Eliminates the performance problems of scripted or interpreted environments .

NET • .NET Framework Class Libraries – Object-oriented collection of reusable types – Sits on-top of the Common Language Runtime • Common Language Runtime (CLR) – Manages code execution at runtime – Memory management.Primary Components of . etc. – Code designed for the CLR is referred to as “Managed Code” . thread management.

Managed execution in the Common Language Runtime (CLR) Managed Code Common Language Runtime (CLR) Requests for existing New CLR-only features. such as opening such as garbage collection a file. mediated by CLR Win32 OS . features.

maintains •Designed for tools security. integrated class Common Language Runtime (CLR) libraries •Unifies programming models Operating System across languages •Enables cross-language integration Common Language Runtime •Factored for extensibility Executes code. handles component “plumbing” and dependencies .NET building and running Web services Data and XML Base Framework Secure.NET Framework VB C++ C# J# Python … ASP.NET Web Services User Interface High-productivity environment for ASP.Inside the .

One Runtime For Many Languages • CLR is an open standard • Any language can make use of CLR services • Any language can use classes written in any other language • Any language can inherit classes written in any other language .

)  Haskell  Perl (Utrecht University) .)  Java Language  Oberon (Zurich University)  COBOL  Oz (Univ of Saarlandes)  Component Pascal (Queensland Univ of Tech)  SmallTalk  ECMAScript (JScript)  Python  Eiffel (Monash  Scheme University) (Northwestern U.Current List of Language Compilers  Ada  lcc  APL (MS Research Redmond)  Basic (Visual Basic)  Mondrian (Utrecht)  ML  C# (MS Research Cambridge)  C  Mercury  C++ (Melbourne U.

basic system functionality (IO. ADO.NET Framework Class Libraries • Sit on top of the CLR • Reusable types that tightly integrate with the CLR • Object oriented – inheritance. etc.NET.. XML. • Provide functionality for ASP. XML Web Services. etc. Windows Forms.) . polymorphism.NET.

The Common Language Runtime • Code that targets the CLR is referred to as managed code • All managed code has the features of the CLR – Object Oriented – Cross-language integration – Cross language exception handling – Multiple version support (no more DLL Hell) .

The Common Language Runtime • The CLR manages object layout and references to objects • Objects whose lifetimes are managed by the CLR are referred to as Managed Data • Automatic memory management reduces memory leaks • In managed code you can use: – Managed Data – Unmanaged data – Both .

The Common Language Runtime • All CLR-compliant compilers use a common type system – Allows for cross-language inheritance – Passing object instances across language barriers – Invoking methods across language barriers • Managed components expose metadata • Metadata includes – Resources component was compiled against – Information about types and dependencies (no more RegServ32) .

//Close the reader reader. //Create a data reader IDataReader reader = eDB. //Advance to the first record in the reader reader. Language Specific Compiler //Populate this instance of the Event class this.Close().Read().EventDB eDB = new DotNetJunkies.StudyGroupPortal.Data.CreateEvent(ref reader).Managed Execution Process public void Fill() { DotNetJunkies.GetEventByGuid(_guid). } MSIL .EventDB().StudyGroupPortal.Data.

exception handling. storing. – Control flow. etc.Microsoft Intermediate Language • Managed code is compiled to MSIL • CPU-independent set of instructions – Loading. initializing and calling methods – Arithmetic and logical operations. direct memory access .

Just-In-Time Compiling • Assemblies are compiled to native code by a Just-In-Time compiler (JITer) • Compiled assemblies include metadata • No Type Libraries or Interface Definition Language (IDL) .

Compilation And Execution Compilation Source Language Code (IL) Assembly Code Compiler Metadata Native JIT Code Compiler Before installation or the first time each Execution method is called .

Just-In-Time Compiling • All assemblies must be compiled to native code before executing • JIT compilers are built into the CLR for every supported CPU architecture • JIT compilers convert MSIL to native on demand • Resulting native code is stored for reuse • JIT compiling occurs for each method after the application is restarted .

Summary • .NET Class Libraries.NET Framework consists of two primary parts: . Common Language Runtime • All CLR-compliant compilers support the common type system • Managed code is object oriented • Managed code is compiled to an assembly (MSIL) by language specific compiler • Assemblies are compiled to native code by JIT compiler .NET Framework is a code execution platform • .

Questions? .