Introducing the Common Language Runtime for.NET. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution.

Slides:



Advertisements
Similar presentations
What is.Net Gary Devendorf. .Net Framework.Net framework works like the Domino Objects only much lower level and very complete It is part of the OS (or.
Advertisements

Introduction to .NET Framework
.NET Framework Overview
Using.NET Platform Note: Most of the material of these slides have been taken & extended from Nakov’s excellent overview for.NET framework, MSDN and wikipedia.
.NET Session Prepared By : Manu Sharma IBE Team. Topics Types of.NET Applications.NET Framework CLR Garbage Collection Importance of.NET.
.NET Framework Overview
History of.Net Introduced by Microsoft Earlier technology was VC++ and VB VC++ comes with so many library and VB was so easy to use and not flexible to.
.NET Framework Overview Pingping Ma Nov 16 th, 2006.
Henrico Dolfing Business Segment Partners. Océ Document Technologies GmbH2 June, NET Framework Version 3.0.
Overview of the.NET Framework. What is the.NET Framework A new computing platform designed to simplify application development A consistent object-oriented.
Lesson 1 What is.NET Prepared by Shawn Dossie Microsoft NYIT.
Intro to C# Language Richard Della Tezra IS 373. What Is C#? C# is type-safe object-oriented language Enables developers to build a variety of secure.
Introducing the Common Language Runtime. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution engine.
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
CSCI 3327 Visual Basic Chapter 1: Introduction to Visual Basic
Lecture Roger Sutton CO530 Automation Tools 5: Class Libraries and Assemblies 1.
.NET Framework Introduction: Metadata
Introduction to .Net Framework
1 8/29/05CS360 Windows Programming Professor Shereen Khoja.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
High thoughts must have high language. Aristophanes
Architecture of.NET Framework .NET Framework ٭ Microsoft.NET (pronounced “dot net”) is a software component that runs on the Windows operating.
Module 1: Introduction to C# Module 2: Variables and Data Types
Session 1 - Introduction and Data Access Layer
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
CIS NET Applications1 Chapter 2 –.NET Component- Oriented Programming Essentials.
.NET Framework & C#.
Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a library for.
Appendix D: Microsoft.NET Framework Overview. Overview.NET Framework Architecture.NET Namespaces.
 Internet providing backbone for applications  Use of several web sites and devices to provide one complete solution  Software as services  Quick software.
Understanding Code Compilation and Deployment Lesson 4.
Importing outside DLLs into.Net platform and using them By Anupama Atmakur.
.NET Framework Overview
Introduction .NET Framework
C# Overview and Features. Content I.History of C# II.Architecture III.How to install IV.Features V.Code Sample VI.Microsoft.NET Platform VII.Why use C#
Lecture 1 Programming in C# Introducing C# Writing a C# Program.
Component-Based Software Engineering Introduction to.NET Paul Krause.
.NET Framework Danish Sami UG Lead.NetFoundry
Introduction to VB.Net. What is.NET? A brand of Microsoft technologies A platform for creating distributed Web applications A combination of new and updated.
1.NET FRAMEWORK CE-105 Spring 2007 Engr. Faisal ur Rehman.
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Application Foundation Presented By : Naveed Sattar Software Engineer.
Languages and IDE (Integrated Development Environment)
Rajiv and Shipra Introduction to.NET (asp.net,c#,vb)
tom perkins1 XML Web Services -.NET FRAMEWORK – Part 1 CHAPTER 1.1 – 1.3.
Module 3: Using Microsoft.NET- Based Languages. Overview Overview of the.NET-Based Languages Comparison of the.NET-Based Languages.
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
.NET Ying Chen Junwei Chen. What is Microsoft.NET. NET is a development platform Incorporated into.NET COM+ component services ASP web development framework.
Microsoft .NET A platform that can be used for building and running windows and web applications such that the software is platform and device-independent.
Getting Started with.NET Getting Started with.NET/Lesson 1/Slide 1 of 31 Objectives In this lesson, you will learn to: *Identify the components of the.NET.
Object Oriented Software Development 4. C# data types, objects and references.
C# and.NET. .NET Architecture  Compiling and running code that targets.NET  Advantages of Microsoft Intermediate Language (MSIL)  Value and Reference.
Common Language Runtime Introduction  The common language runtime is one of the most essential component of the.Net Framework.  It acts.
July 22, 2001Introduction to.NET1 Introduction to.NET Framework Gholamali Semsarzadeh July 2001.
The Execution System1. 2 Introduction Managed code and managed data qualify code or data that executes in cooperation with the execution engine The execution.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
.NET Framework, CLR, MSIL, Assemblies, CTS, etc..
METADATA IN.NET Presented By Sukumar Manduva. INTRODUCTION  What is Metadata ? Metadata is a binary information which contains the complete description.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Intro to ASP.NET CS-422 Dick Steflik. What is.NET As applications in the Enterprise become more and more netcentric and less and less standalone.NET is.
Introduction to the Microsoft.NET Framework Chris Wastchak Student Ambassador to Microsoft.
Computer System Structures
Introduction to .NET framework
CE-105 Spring 2007 Engr. Faisal ur Rehman
.NET and .NET Core 2. .NET Runtimes Pan Wuming 2017.
Introduction to .NET By : Mr. V. D. Panchal Content :
.Net Framework Details Imran Rashid CTO at ManiWeber Technologies.
Module 10: Implementing Managed Code in the Database
Presentation transcript:

Introducing the Common Language Runtime for.NET

The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution engine of The.NET Framework –Offers many system services –Similar to an OS –Runs on a host OS The.NET Framework The.NET Framework –New platform by Microsoft –Designed to target the Internet

The Purpose of the CLR… Safe binary execution Safe binary execution –Security, memory protection –Running un-trusted code, locally Performance and Functionality Performance and Functionality –Native execution (JIT Compiled) –No Sandbox

…The Purpose of the CLR Bug reduction Bug reduction –More code interacting, bugs affect more users Ease of integration Ease of integration Developer investment Developer investment –Reuse skills from project to project, even if the projects are vastly different

Managed Code and the CLR The Common Language Runtime (CLR) is a runtime engine The Common Language Runtime (CLR) is a runtime engine –Manages.NET Code (such as C# applications) –Provides features such as memory management, thread management, object type safety, security, etc. –Is a part of the.NET Framework

Windows (or other operating oystem) Common Language Runtime (JIT compilation, memory management, etc.) Legacy Software (unmanaged code) Managed Executable Reusable Managed Components The CLR and Managed Code

What is Managed Code Code that targets the CLR Code that targets the CLR –C#, VB.NET, PERL, Java, C++, Cobol, etc. All Managed code has all features of CLR All Managed code has all features of CLR –Object oriented infrastructure –Internet oriented infrastructure –Access to the Framework Class Library (FCL) All Managed executables consist of All Managed executables consist of –Intermediate Language (IL) instructions –Metadata

IL and Metadata (MSIL – microsoft intermediate language) IL CPU independent machine language IL CPU independent machine language –Just-in-time compiled at runtime –Makes cross-language integration possible. Metadata Metadata –Structured information –describes programming constructs including Classes definitions, field and method definitions, parameter lists, return types, etc. Classes definitions, field and method definitions, parameter lists, return types, etc.

ILDasm.exe Use ILDasm.exe to view IL for managed executable Use ILDasm.exe to view IL for managed executable

Just-in-Time Compiling All managed code runs in native machine language All managed code runs in native machine language All managed code is made up of IL and metadata All managed code is made up of IL and metadata The CLR JIT-compiles the IL and metadata The CLR JIT-compiles the IL and metadata –At execution time –Executed directly by CPU Allows for the best of both worlds Allows for the best of both worlds –Code management features –Performance of full-speed execution

Running Process’ Memory SomeSources.exe IL Metadata JIT Compiler Native Machine Language The CPU executes the JIT- compiled machine code directly At execution time the IL and Metadata are JIT compiled Executing a Managed Application

Assembly vs. Managed Module Deployment of managed code broken-up into to logical concepts Deployment of managed code broken-up into to logical concepts –Assembly –Managed module Managed module Managed module –Single physical file –Contains type definitions –Cannot be executed or used directly Assembly Assembly –Unit of versioning, deployment, and security –Can consist of multiple files Managed modules Managed modules Resource files Resource files

Reasons for Assemblies Decouple concepts of physical and logical deployment Decouple concepts of physical and logical deployment –Logically, you deploy a complete assembly –Physically, deploy only necessary files Performance enhancement for network deployment Performance enhancement for network deployment Include resource files Include resource files –No embedding –Resource files retain their identity Smiley.jpg, Info.xml, etc. Smiley.jpg, Info.xml, etc.

Versioning Assemblies Assemblies can be strongly named Assemblies can be strongly named –Includes public/private key information Strong named assemblies bind by version Strong named assemblies bind by version –Code that uses V1 uses V1 even after V2 is installed on the system –Avoids DLL hell –Gives you the freedom to make V2 components incompatible with V1 Strong binding is a major improvement over DLLs Strong binding is a major improvement over DLLs

Reflection Programmatically gain access to metadata at runtime Programmatically gain access to metadata at runtime Used to make ultra-flexible code Used to make ultra-flexible code Components often perform reflection to find out about derivations Components often perform reflection to find out about derivations –Custom attributes Late and loose binding are possible with reflection Late and loose binding are possible with reflection –Instantiate objects, call methods, etc. Reflection Emit Reflection Emit –Possible to emit IL at runtime, JIT compile & execute

Automatic Memory Management The CLR manages memory for managed code The CLR manages memory for managed code –All allocations of objects and buffers made from a Managed Heap –Unused objects and buffers are cleaned up automatically through Garbage Collection Some common software bugs are not possible with managed code Some common software bugs are not possible with managed code –Leaked memory or objects –References to freed or non-existent objects –Reading of uninitialized variables Impossible to gain access to memory with object reference Impossible to gain access to memory with object reference

The Managed Heap Reduces bugs Reduces bugs Makes code access security possible Makes code access security possible –No direct memory access Makes type safety possible Makes type safety possible –Incompatible type coercion not possible Performance Performance –Newing up objects is much faster than malloc() –Garbage collection can be a perf-hit

Garbage Collection Garbage collection occurs when a “new” operation fails due to lack of memory Garbage collection occurs when a “new” operation fails due to lack of memory All managed threads are stopped All managed threads are stopped Collection starts with roots, and recursively finds referenced objects Collection starts with roots, and recursively finds referenced objects –Roots == globals, locals, cpu registers Referenced objects are moved down in the managed heap, Referenced objects are moved down in the managed heap, –Making space available at the end –Removing unreachable objects –No Fragmentation References fixed-up and managed threads restarted References fixed-up and managed threads restarted

A B E D C The Managed Heap = Object or buffer in memory class MyClass{ void Method(){ Variable v1; Variable v2; do{. Objects A and D will be cleaned up because neither is directly or indirectly referenced by code Garbage Collection

CLR Summary The platform for managed code The platform for managed code –C#, VB.NET, etc. Features Features –Memory management, security management, reflection, type safety –IL, metadata, JIT compilation –Assemblies, managed modules Understanding the platform will make coding.NET code easier Understanding the platform will make coding.NET code easier –C#, VB.NET, etc.