Introduction .NET Framework

Slides:



Advertisements
Similar presentations
Introduction to .NET Framework
Advertisements

.NET Framework Overview
Tahir Nawaz Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a.
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.
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.
.NET Technology.
CIM2564 Introduction to Development Frameworks 1 Overview of a Development Framework Topic 1.
Overview of the.NET Framework. What is the.NET Framework A new computing platform designed to simplify application development A consistent object-oriented.
Programming Our First Java Program Yingcai Xiao. What to Do Set up for Java Programming Write our first Java Program with IDE Write our first Java Program.
Introduction to the C# Programming Language for the VB Programmer.
Introducing the Common Language Runtime for.NET. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution.
Introducing the Common Language Runtime. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution engine.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
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.
Overview of Microsoft.Net and Vb.Net ITSE 2349 Spring 2002 Material from Microsoft.Net an Overview for ACC faculty by Stuart Laughton and Introduction.
Lecture Roger Sutton CO530 Automation Tools 5: Class Libraries and Assemblies 1.
Introduction to .Net Framework
ASP.NET The.NET Framework. The.NET Framework is Microsoft’s distributed run-time environment for creating, deploying, and using applications over the.
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.
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
C# A 1 CSC 298 Introduction to C#. C# A 2 What to expect in this class  Background: knowledge of an object oriented language of the C++, Java, … family.
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.
Introduction to .NET Rui Ye.
 Internet providing backbone for applications  Use of several web sites and devices to provide one complete solution  Software as services  Quick software.
Introduction to .NET Framework
Understanding Code Compilation and Deployment Lesson 4.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
.NET Framework Overview
ASSEMBLY. A SSEMBLY Assemblies are the fundamental units of applications in the.net framework An assembly can contain classes, structures, interfaces.
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#
ISYS 573 Special Topic – VB.Net David Chao. The History of VB Early 1960s:BASIC-Beginner’s All-Purpose Symbolic Instruction Code –Teaching –Simple syntax,
CS795/895: Introduction. Topics Distributed Systems –Availability –Performance –Web Services Security –Authentication –Authorization –Confidentiality.
.NET Framework Danish Sami UG Lead.NetFoundry
MSIL & CLI Kun-Yuan Shieh.
Programming in C#. I. Introduction C# (or C-Sharp) is a programming language. C# is used to write software that runs on the.NET Framework. Although C#
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Application Foundation Presented By : Naveed Sattar Software Engineer.
tom perkins1 XML Web Services -.NET FRAMEWORK – Part 1 CHAPTER 1.1 – 1.3.
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.
Architecture of.Net Framework. Multiple Language Support  IL (MSIL or CIL) – Intermediate Language  It is low-level (machine) language, like Assembler,
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.
Common Language Runtime Introduction  The common language runtime is one of the most essential component of the.Net Framework.  It acts.
INTRODUCTION CHAPTER #1 Visual Basic.NET. VB.Net General features It is an object oriented language  In the past VB had objects but focus was not placed.
July 22, 2001Introduction to.NET1 Introduction to.NET Framework Gholamali Semsarzadeh July 2001.
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.
Just-In-Time Compilation. Introduction Just-in-time compilation (JIT), also known as dynamic translation, is a method to improve the runtime performance.
INTRODUCTION BEGINNING C#. C# AND THE.NET RUNTIME AND LIBRARIES The C# compiler compiles and convert C# programs. NET Common Language Runtime (CLR) executes.
Introduction to the Microsoft.NET Framework Chris Wastchak Student Ambassador to Microsoft.
.NET Framework.
Introducing the Microsoft® .NET Framework
Introduction to .NET framework
.NET and .NET Core 2. .NET Runtimes Pan Wuming 2017.
Introduction to C# AKEEL AHMED.
Programming in C# CHAPTER 1
.NET Base Type (CTS Data Type) Managed Extensions for C++ Keyword
DOT NET ARCHITECTURE (OR) DOT NET FRAME WORK ARCHITECTURE
Presentation transcript:

Introduction .NET Framework

.NET Framework .NET Framework is a complete environment that allows developers to develop, execute, and deploy the following applications: Console applications Windows Forms applications Windows Presentation Foundation (WPF) applications Web applications (ASP.NET applications) Web services Windows services Service-oriented applications using Windows Communication Foundation (WCF) Workflow-enabled applications using Windows Workflow Foundation (WF) .NET Framework also enables a developer to create sharable components to be used in distributed computing architecture. .NET Framework supports the object-oriented programming model for multiple languages, such as Visual Basic, Visual C#, and Visual C++. .NET Framework supports multiple programming languages in a manner that allows language interoperability.

Features / Advantages Interoperability .Net framework provides the way to operate .Net application outside the .Net environment. Access to COM components is facilitated to .Net developers in the SRIS and System Enterprise Services namespace. By this facility this platform is increasing the communication between new applications and the old applications. Common Language Runtime engine Common Language Runtime (CLR) is the virtual machine component of the .NET framework. All .NET programs execute under the supervision of the CLR, and it provides memory management, security, and exception handling. Language independence .NET Framework introduces a Common Type System, or CTS. The CTS specification defines all possible data types and programming constructs supported by the CLR and how they may or may not interact with each other. Because of this feature, the .NET Framework supports the exchange of instances of types between programs written in any of the .NET languages.

Features / Advantages Base Class Library The Base Class Library (BCL), part of the Framework Class Library (FCL), is a library of functionality available to all languages using the .NET Framework. The BCL provides classes which encapsulate a number of common functions, including file reading and writing, graphic rendering, database interaction and XML document manipulation. Simplified deployment The .NET framework includes design features and tools that help manage the installation of computer software to ensure that it does not interfere with previously installed software, and that it conforms to security requirements. Security The design is meant to address some of the vulnerabilities, such as buffer overflows, that have been exploited by malicious software. Additionally, .NET provides a common security model for all applications. Portability .NET framework permits it to be platform agnostic, and therefore it is compatible with different platforms. This feature of Microsoft .NET framework also makes a way for third parties to develop compatible implementations of this framework and its languages on platforms other than Microsoft.

Common Language Infrastructure (CLI) CLI is an open specification developed by Microsoft and standardized by ISO and ECMA. CLI describes the executable code and runtime environment that form the core of the Microsoft .NET Framework and the free and open source implementations Mono and Portable.NET. The specification defines an environment that allows multiple high-level languages to be used on different computer platforms without being rewritten for specific architectures. CLI specification describes the following four aspects: Common Type System (CTS) Metadata Common Language Specification (CLS) Virtual Execution System (VES)   The Common Language Infrastructure (CLI) is an open specification developed by Microsoft and standardized by ISO and ECMA that describes the executable code and runtime environment that form the core of the Microsoft .NET Framework and the free and open source implementations Mono and Portable.NET. The specification defines an environment that allows multiple high-level languages to be used on different computer platforms without being rewritten for specific architectures. ISO - International Organization for Standardization ECMA - European Computer Manufacturers Association The Common Type System (CTS): A set of data types and operations that are shared by all CTS-compliant programming languages. Metadata: Information about program structure is language-agnostic, so that it can be referenced between languages and tools, making it easy to work with code written in a language you are not using. Common Language Specification (CLS): A set of base rules to which any language targeting the CLI should conform in order to interoperate with other CLS-compliant languages. The CLS rules define a subset of the Common Type System. Virtual Execution System (VES): The VES loads and executes CLI-compatible programs, using the metadata to combine separately generated pieces of code at runtime. All compatible languages compile to Common Intermediate Language (CIL), which is an intermediate language that is abstracted from the platform hardware. When the code is executed, the platform-specific VES will compile the CIL to the machine language according to the specific hardware and operating system.

Common Language Infrastructure (CLI) The Common Language Infrastructure (CLI) is an open specification developed by Microsoft and standardized by ISO and ECMA that describes the executable code and runtime environment that form the core of the Microsoft .NET Framework and the free and open source implementations Mono and Portable.NET. The specification defines an environment that allows multiple high-level languages to be used on different computer platforms without being rewritten for specific architectures. ISO - International Organization for Standardization ECMA - European Computer Manufacturers Association The Common Type System (CTS): A set of data types and operations that are shared by all CTS-compliant programming languages. Metadata: Information about program structure is language-agnostic, so that it can be referenced between languages and tools, making it easy to work with code written in a language you are not using. Common Language Specification (CLS): A set of base rules to which any language targeting the CLI should conform in order to interoperate with other CLS-compliant languages. The CLS rules define a subset of the Common Type System. Virtual Execution System (VES): The VES loads and executes CLI-compatible programs, using the metadata to combine separately generated pieces of code at runtime. All compatible languages compile to Common Intermediate Language (CIL), which is an intermediate language that is abstracted from the platform hardware. When the code is executed, the platform-specific VES will compile the CIL to the machine language according to the specific hardware and operating system.

Common Intermediate Language (CIL) (CIL) Common Intermediate Language is also known as (MSIL) Microsoft Intermediate Language or IL ( Intermediate Language). CIL is the lowest-level human-readable programming language defined by the Common Language Infrastructure (CLI) specification. All .NET source code is compiled to CIL. Then CIL will be converted to native code and code will be executed at run-time by a Just-In- Time (JIT) compiler.   The Common Language Infrastructure (CLI) is an open specification developed by Microsoft and standardized by ISO and ECMA that describes the executable code and runtime environment that form the core of the Microsoft .NET Framework and the free and open source implementations Mono and Portable.NET. The specification defines an environment that allows multiple high-level languages to be used on different computer platforms without being rewritten for specific architectures. ISO - International Organization for Standardization ECMA - European Computer Manufacturers Association The Common Type System (CTS): A set of data types and operations that are shared by all CTS-compliant programming languages. Metadata: Information about program structure is language-agnostic, so that it can be referenced between languages and tools, making it easy to work with code written in a language you are not using. Common Language Specification (CLS): A set of base rules to which any language targeting the CLI should conform in order to interoperate with other CLS-compliant languages. The CLS rules define a subset of the Common Type System. Virtual Execution System (VES): The VES loads and executes CLI-compatible programs, using the metadata to combine separately generated pieces of code at runtime. All compatible languages compile to Common Intermediate Language (CIL), which is an intermediate language that is abstracted from the platform hardware. When the code is executed, the platform-specific VES will compile the CIL to the machine language according to the specific hardware and operating system.

Common Language Runtime (CLR) Common Language Runtime (CLR) is the virtual machine and core component of Microsoft's .NET framework and is responsible for managing the execution of .NET programs. CLR is a common runtime environment for .NET native code which is converted by MSIL or IL (Intermediate Language) from bytecode that is complied with .NET compilers of respective language in .NET Framework. CLR performs various tasks to manage the execution process of .NET applications. The responsibilities of CLR are listed as follows: Automatic memory management Garbage Collection Code Access Security Code verification JIT compilation of .NET code

Common Language Runtime (CLR)

Common Type System (CTS) The Common Type System (CTS) defines how types are declared, used and managed in the runtime, and is also an important part of the runtime(CLR)'s support for cross-language integration. The common type system performs the following functions: Establishes a framework that helps enable cross-language integration, type safety, and high-performance code execution. Provides an object-oriented model that supports the complete implementation of many programming languages. Defines rules that languages must follow, which helps ensure that objects written in different languages can interact with each other. Provides a library that contains the primitive data types (such as Boolean, Byte, Char, Int32, and UInt64) used in application development.

Common Type System (CTS) All types in the .NET Framework are either value types or reference types: Value types are data types whose objects are represented by the object's actual value. If an instance of a value type is assigned to a variable, that variable is given a fresh copy of the value. Reference types are data types whose objects are represented by a reference (similar to a pointer) to the object's actual value. If a reference type is assigned to a variable, that variable references (points to) the original value. No copy is made.

Common Language Specification (CLS) It is a sub set of CTS and it specifies a set of rules that needs to be adhered or satisfied by all language compilers targeting CLR. It helps in cross language inheritance and cross language debugging. Common language specification Rules: 1. Representation of text strings  2. Internal representation of enumerations  3. Definition of static members and this is a subset of the CTS which all .NET languages are expected to support. 4. Microsoft has defined CLS which are nothing but guidelines that language to follow so that it can communicate with other .NET languages in a seamless manner.

Framework Class Library (FCL) The .NET Framework class library is a library of classes, interfaces, and value types that provide access to system functionality. It is the foundation on which .NET Framework applications, components, and controls are built.  FCL contains thousands of classes to provide the access to Windows API and common functions like String Manipulation, Common Data Structures, IO, Streams, Threads, Security, Network Programming, Windows Programming, Web Programming, Data Access, etc. It is simply the largest standard library ever shipped with any development environment or programming language. The best part of this library is they follow extremely efficient OO design (design patterns) making their access and use very simple and predictable.

namespace The namespace  is used to declare a scope that contains a set of related objects. You can use a namespace to organize code elements and to create globally unique types. Namespace is a collection of types. A namespace can contain one or more of the following types: class, struct, interface, enum and delegate A namespace can have one or more sub namespaces defined in it. Namespace also avoids collision between names of types in a program. By default a program has a namespace called <global namespace> using directive to allow the use of types in a namespace so that you do not have to qualify the use of a type in that namespace: ex. using System;

namespace Namespaces are heavily used in C# programming in two ways. First, the .NET Framework uses namespaces to organize its many classes, as follows: System is a namespace and Console is a class in that namespace. The using keyword can be used so that the complete name is not required, as in the following example: using System; System.Console.WriteLine("Hello World!"); Second, declaring your own namespaces can help you control the scope of class and method names in larger programming projects. Use the namespace keyword to declare a namespace, as in the following example: Example: namespace SampleNamespace { class SampleClass public void SampleMethod() System.Console.WriteLine( "SampleMethod inside SampleNamespace"); } Using SampleNamespace;

Assembly Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security. An assembly consist of one or more files (dlls , exe’s. html files etc.), and represents a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly is completely self-describing. An assembly contains metadata and manifest.

Types of Assembly There are the two types of assemblies: Private Assembly - Refers to the assembly that is used by a single application. Private assemblies are kept in a local folder in which the client application has been installed. Public or Shared Assembly - Refers to the assembly that is allowed to be shared by multiple applications. A shared assembly must reside in Global Assembly Cache (GAC) with a strong name assigned to it. For example, imagine that you have created a DLL containing information about your business logic. This DLL can be used by your client application. In order to run the client application, the DLL must be included in the same folder in which the client application has been installed. This makes the assembly private to your application. Now suppose that the DLL needs to be reused in different applications. Therefore, instead of copying the DLL in every client application folder, it can be placed in the global assembly cache using the GAC tool. These assemblies are called shared assemblies.

Metadata An assembly metadata is binary information which describes the description of an assembly, such as name, version, culture, public key of an assembly along with the types exported, other assemblies dependent on this assembly, and security permissions needed to run the application. In addition, it stores the description of types, such as the name, visibility, base class, interfaces implemented, and members, such as methods, fields, properties, events, attributes and nested types. Metadata is stored in binary format. Therefore, metadata of an assembly is sharable among applications that execute on various platforms. It can also be exported to other applications to give information about the services and various features of an application.

Manifest Assemblies maintain all their information in a special unit called the manifest. Every assembly has a manifest. The followings are the contents of an Assembly Manifest:

Execution Model of Assembly

Just-In-Time (JIT) JIT compiler translates the MSIL code of an assembly to native code and uses the CPU architecture of the target machine to execute a .NET application. It also stores the resulting native code so that it is accessible for subsequent calls. If a code executing on a target machine calls a non-native method, the JIT compiler converts the MSIL of that method into native code. JIT compiler also enforces type-safety in the runtime environment of the .NET Framework. It checks for the values that are passed to parameters of any method. The following are the various types of JIT compilation in .NET: Pre - JIT Econo - JIT Normal - JIT

Types of JIT Pre - JIT Econo - JIT Normal - JIT In Pre-JIT compilation, complete source code is converted into native code in a single cycle (i.e. compiles the entire code into native code in one stretch) This is done at the time of application deployment. In .Net it is called "Ngen.exe“ Econo - JIT In Econo-JIT compilation, the compiler compiles only those methods that are called at run time. After execution of this method the compiled methods are removed from memory. Normal - JIT In Normal-JIT compilation, the compiler compiles only those methods that are called at run time. After executing this method, compiled methods are stored in a memory cache. Now further calls to compiled methods will execute the methods from the memory cache.

Managed Code & Unmanage Code The code which is produced by (vb.net,c#,j#) .net framework language is called as managed code which is under the control of CLR.Garbage collector run automatically in managed code.  The code which is produced by third party language is called as unmanaged code, which does not run under the control of CLR.Garbage collector will not run in case of unmanaged code.

Operating system services CLR Execution Model Source code VB C# C++ Unmanaged component Compiler Compiler Compiler Managed code Assembly IL code Assembly IL code Assembly IL code Common language runtime JIT compiler Native code Operating system services