Showing posts with label .NET Framework. Show all posts
Showing posts with label .NET Framework. Show all posts
The .NET framework is a collection of classes that provides programmers with what basically they need to develop applications.
The classes defined in .NET are language neutral; they can be used in C++, C#, Visual Basic.NET, J-Script, (which are native languages for .NET framework) and other languages.
The .NET does not provide a virtual machine. The software is fully compiled to an intermediate language (IL)
At run time, a just-in-time (JIT) compiler compiles the IL code to the final executable form.
IL contains: (metadata) complete description of interfaces, properties, methods. It is similar to assembly language and full fledged, stack based language.
Common Language Runtime (CLR) is a morden runtime environment that manages the execution of the user code. It provides services that components use to interact with the computer or the native OS of the machine. CLR is portable on different platforms. It also contains JIT compiler and defines a share type system  which defines the rules by which all types are declared regardless of source language.
Common Type System (CTS) specifies no particular syntax or keywords, but defines a common set of types that can be used with many different language syntax. 
CTS supports inheritance.
Since all types are represented by CTS types, all managed languages ultimately declare CTS types.
What is managed languages? All languages that support CTS
What is the important of the stack? The stack is an area (construct) of the memory, that works with push and pop, it is used to pass parameters to the function call or return values or references.
Notes: when you allocate the data, the data goes in to the heap. Besides, if the variables which are contained only within the methods, then those variables are in the stack.

Garbage Collection: moves objects to consolidate the used and free spaces.
To optimize the performance, the managed heap is divided into three heaps (called generations): 0, 1, 2
The run-time GC stores new objects in generation 0. Objects created early in the application's lifetime survive will promoted and stored in generations 1 and 2.
Tips: using iDisposable to manage the resources that you are using to tell an object when you are done with it.
Design goals of C#:
-to support component concepts like events, methods, and properties
-everything is an object, allow to create clean designs
-to create robust and maintainable software
-is component-oriented, which address issues of reuse and deployment.
 

Copyright © 2013-2014 Lai Duy Thanh All rights reserved.