architecture in .net

37
ARCHITECTURE IN .NET Larry Nung

Upload: larry-nung

Post on 21-Jul-2015

50 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Architecture in .net

ARCHITECTURE IN .NETLarry Nung

Page 2: Architecture in .net

AGENDA

Overview

Common Language Infrastructure (CLI)

Common Language Runtime (CLR)

Just In Time Compiler (JIT)

Common Intermediate Language (CIL)

Base Class Library (BCL)

Framework Class Library (FCL)

Common Type System (CTS)

Common Language Specification (CLS)

Reference

Q & A2

Page 3: Architecture in .net

OVERVIEW

3

Page 4: Architecture in .net

OVERVIEW

4

Page 5: Architecture in .net

COMMON LANGUAGE

INFRASTRUCTURE (CLI)5

Page 6: Architecture in .net

COMMON LANGUAGE INFRASTRUCTURE (CLI)

An open specification describes the executable

code and runtime environment.

6

Page 7: Architecture in .net

COMMON LANGUAGE RUNTIME (CLR)7

Page 8: Architecture in .net

COMMON LANGUAGE RUNTIME (CLR)

The .NET Framework provides a run-time

environment called the common language runtime,

which runs the code and provides services that

make the development process easier.

8

Page 9: Architecture in .net

COMMON LANGUAGE RUNTIME (CLR)

9

Page 10: Architecture in .net

COMMON LANGUAGE RUNTIME (CLR)

Performance improvements.

The ability to easily use components developed in other languages.

Extensible types provided by a class library.

Language features such as inheritance, interfaces, and overloading for object-oriented programming.

Support for explicit free threading that allows creation of multithreaded, scalable applications.

Support for structured exception handling.

Support for custom attributes.

Garbage collection.

Use of delegates instead of function pointers for increased type safety and security. For more information about delegates, see Common Type System.

10

Page 11: Architecture in .net

COMMON LANGUAGE RUNTIME (CLR)

11

Page 12: Architecture in .net

JUST IN TIME COMPILER (JIT)12

Page 13: Architecture in .net

JUST IN TIME COMPILER (JIT)

JIT compilation converts MSIL to native code on

demand at application run time, when the contents

of an assembly are loaded and executed.

13

Page 14: Architecture in .net

JUST IN TIME COMPILER (JIT)

Normal-JIT Compiler

Compile methods in runtime as needed.

14

Page 15: Architecture in .net

JUST IN TIME COMPILER (JIT)

Econo-JIT

A runtime compiler which hadn’t done any optimization

and removed methods’ machine code when it is not

required.

15

Page 16: Architecture in .net

Pre-JIT Compiler

Compile the entire assembly before it has been used.

16

Page 17: Architecture in .net

COMMON INTERMEDIATE LANGUAGE

(CIL)17

Page 18: Architecture in .net

COMMON INTERMEDIATE LANGUAGE (CIL)

Microsoft intermediate language (MSIL)

Lowest-level human-readable programming

language defined by the Common Language

Infrastructure (CLI) specification

18

Page 19: Architecture in .net

BASE CLASS LIBRARY (BCL)19

Page 20: Architecture in .net

BASE CLASS LIBRARY (BCL)

The Base Class Library (BCL) is the core set of

classes that serve as the basic API of the Common

Language Runtime. The classes in mscorlib.dll and

some of the classes in System.dll and

System.core.dll are considered to be a part of the

BCL. It includes the classes in namespaces like

System , System.Diagnostics ,

System.Globalization, System.Resources ,

System.Text , System.Runtime.Serialization and

System.Data etc.

20

Page 21: Architecture in .net

BASE CLASS LIBRARY (BCL)

21

Page 22: Architecture in .net

FRAMEWORK CLASS LIBRARY (FCL)22

Page 23: Architecture in .net

FRAMEWORK CLASS LIBRARY (FCL)

The Framework Class Library (FCL) is a superset

of the BCL classes and refers to the entire class

library that ships with .NET Framework. It includes

an expanded set of libraries, including Windows

Forms, ADO.NET, ASP.NET, Language Integrated

Query, Windows Presentation Foundation,

Windows Communication Foundation among others.

23

Page 24: Architecture in .net

FRAMEWORK CLASS LIBRARY (FCL)

24

Page 25: Architecture in .net

COMMON TYPE SYSTEM (CTS)25

Page 26: Architecture in .net

COMMON TYPE SYSTEM (CTS)

Define how types are declared, used, and managed

in the common language runtime.

26

Page 27: Architecture in .net

COMMON TYPE SYSTEM (CTS)

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. 27

Page 28: Architecture in .net

COMMON TYPE SYSTEM (CTS)

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.

28

Page 29: Architecture in .net

COMMON TYPE SYSTEM (CTS)

29

Page 30: Architecture in .net

COMMON LANGUAGE SPECIFICATION

(CLS)30

Page 31: Architecture in .net

COMMON LANGUAGE SPECIFICATION (CLS)

This is a subset of the CTS, which all .NET

languages are expected to support.

31

Page 32: Architecture in .net

REFERENCE

32

Page 33: Architecture in .net

REFERENCE

Common Language Infrastructure - Wikipedia, the

free encyclopedia

http://en.wikipedia.org/wiki/Common_Language_Infrastr

ucture

Common Type System

https://msdn.microsoft.com/en-

us/library/zcx1eb1e(v=vs.71).aspx

Common Type System - Wikipedia, the free

encyclopedia

http://en.wikipedia.org/wiki/Common_Type_System

Ashu's Tricks

http://ashujagtap333.blogspot.tw/ 33

Page 34: Architecture in .net

REFERENCE

Common Language Specification

https://msdn.microsoft.com/en-us//library/vstudio/12a7a7h3(v=vs.100).aspx

Standard ECMA-335

http://www.ecma-international.org/publications/standards/Ecma-335.htm

Common Language Runtime (CLR)

https://msdn.microsoft.com/en-us//library/8bs2ecf4(v=vs.110).aspx

通用語言運行庫 -維基百科,自由的百科全書 http://zh.wikipedia.org/wiki/%E9%80%9A%E7%94%A8

%E8%AA%9E%E8%A8%80%E9%81%8B%E8%A1%8C%E5%BA%AB 34

Page 35: Architecture in .net

REFERENCE

Common Intermediate Language - Wikipedia, the free encyclopedia

http://en.wikipedia.org/wiki/Common_Intermediate_Language

Standard Libraries (CLI) - Wikipedia, the free encyclopedia

http://en.wikipedia.org/wiki/Standard_Libraries_(CLI)

.NET Compilation - Part 1: Just-In-Time Compiler.

http://geekswithblogs.net/ilich/archive/2013/07/09/.net-compilation-part-1.-just-in-time-compiler.aspx

Compiling MSIL to Native Code

https://msdn.microsoft.com/en-us/library/ht8ecch6%28v=vs.90%29.aspx 35

Page 36: Architecture in .net

REFERENCE

Explain JIT, Ngen.exe, Pre-jit, Normal-Jit and

Econo-Jit.? (.NET interview questions) - YouTube

https://www.youtube.com/watch?v=17AtWvLMFrU

Different Types of JIT Complier

http://www.dotnet-

tricks.com/Tutorial/netframework/1TG6181013-

Different-Types-of-JIT-Complier.html

36

Page 37: Architecture in .net

QUESTION & ANSWER

37