15
iFour Consultancy .NET Framework architecture

Dot net framework architecture by software developmet company india

Embed Size (px)

Citation preview

Page 1: Dot net framework architecture by software developmet company india

iFour Consultancy

.NET Framework architecture

Page 2: Dot net framework architecture by software developmet company india

DefinitionCommon Language Runtime(CLR)MSIL (Microsoft Intermediate Language)JIT (Just-in-Time)CTS (Common Type Specification)CLS (Common Language Specification)Managed CodeUnmanaged CodeAssembliesGarbage Collector(GC)

INDEX

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India

Page 3: Dot net framework architecture by software developmet company india

Definition

A programming infrastructure created by Microsoft for building, deploying, and running applications and services that use .NET technologies, such as desktop applications and Web services

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India

Page 4: Dot net framework architecture by software developmet company india

Common Language Runtime(CLR)

Net Framework provides run time environment called Common Language Runtime (CLR), It provides an environment to run all the .NET Programs

The code which runs under the CLR is called as Managed Code Language Compilers (e.g. C#, VB.NET, J#) will convert the Code/Program to Microsoft Intermediate

Language (MSIL) intern this will be converted to Native Code by CLR

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India

Page 5: Dot net framework architecture by software developmet company india

MSIL (Microsoft Intermediate Language)

When we compile our .NET Program using any .NET compliant language like (C#, VB.NET, C++.NET) it does not get converted into the executable binary code but to an intermediate code, called MSIL

It is language independent codeWhen you compile code that uses the .NET Framework libraryThe MSIL code is not specific to any operating system or to any language

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India

Page 6: Dot net framework architecture by software developmet company india

JIT (Just-in-Time)

When our MSIL compiled code needs to be executed, CLR invokes JIT compilers which compile the MSIL code to native executable code (.exe or .dll) for the specific machine and OS

The just - in - time part of the name reflects the fact that MSIL code is only compiled as, and when, it is needed

JIT compilers (as their name suggests) use MSIL code, which is independent of the machine, operating system, and CPU

Three types JIT• Pre JIT - It converts all the code in executable code and it is slow• Econo JIT - It will convert the called executable code only. But it will convert code every time when a

code is called again• Normal JIT - It will only convert the called code and will store in cache so that it will not require

converting code again, Normal JIT is fast

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India

Page 7: Dot net framework architecture by software developmet company india

CTS (Common Type Specification)

It is a set of standardsDefines the basic data types that MSIL understands. Each .NET compliant language should

map its data types to these standard data typesThis makes it possible for the 2 languages to communicate with each other by

passing/receiving parameters to/from each otherFor example, CTS defines a type Int32, an integral data type of 32 bits (4 bytes) which is

mapped by C# through int and VB.Net through its Integer data type

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India

Page 8: Dot net framework architecture by software developmet company india

CLS (Common Language Specification)

Microsoft has released a small set of specification that each language should meet to qualify as a .NET Compliant Language

It is a subset of CTS. All instruction is in CLS i.e. instruction of CTS is written in CLSCLS basically addresses to language design issues and lays certain standards like there

should be no global function declaration, no pointers, no multiple inheritance

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India

Page 9: Dot net framework architecture by software developmet company india

Managed Code

The code that is written to target the services of the managed runtime execution environment such as Common Language Runtime in .NET Technology

It runs under a Common Language Runtime cannot be accessed outside the runtime environment as well as cannot be called directly from outside the runtime environment

It refers to a contract of cooperation between natively executing code and the runtimeIt offers services like garbage collection, run-time type checking, reference checking etc

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India

Page 10: Dot net framework architecture by software developmet company india

Unmanaged Code

It compiles straight to machine code and directly executed by the Operating SystemThe generated code runs natively on the host processor and the processor directly

executes the code generated by the compilerIt is always compiled to target a specific architecture and runs on the intended platformIf you want to run the same code on different architecture then you will have to recompile

the code using that particular architectureUnmanaged executable files are basically a binary image, x86 code, directly loaded into

memoryAll code compiled by traditional C/C++ compilers are Unmanaged CodeCOM components, ActiveX interfaces, and Win32 API functions are examples of

unmanaged code

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India

Page 11: Dot net framework architecture by software developmet company india

Assemblies

When you compile an application, the MSIL code created is stored in an assemblyIt includes both executable application files that you can run directly from Windows

without the need for any other programs (these have a .exe file extension), and libraries (which have a .dll extension) for use by other applications

All the .NET assemblies contain the definition of types, versioning information for the type, meta-data, and manifest. The designers of .NET have worked a lot on the component (assembly) resolution

There are two kind of assemblies in .NET• Private• Shared

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India

Page 12: Dot net framework architecture by software developmet company india

Assemblies

Private• 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• Example

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

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• Example

Created 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

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India

Page 13: Dot net framework architecture by software developmet company india

Garbage Collector(GC)

CLR also contains Garbage Collector (GC) which runs in a low-priority thread and checks for un-referenced dynamically allocated memory space

The garbage collector performs the memory copy function to compress the objects in the managed heap

It divides the objects on the managed heap into three generations: 0, 1, and 2. Generation 0 contains recently created objects

The garbage collector first collects the unreachable objects in generation 0. Next, the garbage collector compacts memory and promotes the reachable objects to generation 1

The garbage collection can explicitly release these system resources by providing the cleanup code in the Dispose method of the object

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India

Page 14: Dot net framework architecture by software developmet company india

https://msdn.microsoft.com/en-us/library/zw4w595w(v=vs.110).aspx http://www.c-sharpcorner.com/uploadfile/puranindia/net-framework-and-architecture/

References

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India

Page 15: Dot net framework architecture by software developmet company india

Questions?

http://www.ifourtechnolab.com/

VB.NET Software Development Companies India