COMMON TYPE SYSTEM  [CTS]

  • The Common type system (CTS) standardizes the data types of all programming language under .Net framework.  OR
  • The CTS is a standard for defining and using data types in the .Net framework.
  • CTS define a collection of data types which are used and managed by the run-time to facilitate cross-language integration.
  • CTS is a specification created by Microsoft's and included in the European computer manufacturer's association standard.

TYPES OF CTS

There are two types of CTS that every .Net programming language have :-
  1. Value types.
  2. Reference types.

Value types

  • Value types directly  store/contain the value [data] into the memory location.
  • These types work with stack mechanism only.
  • CLR allots memory for value type at compile time.
  • They can be built-in standard (primitive types) user-defined (defined in source code) OR enumerations (represented by labels but stored as a numeric type).
  • Variable that are value types each have their own copy of the data and therefore operations on one variable do not affect other variable.

 Reference types

  • Reference types contain/store a reference to the value's memory address.
  • These types work with heap mechanism.
  • CLR allots memory for reference types at run-time.
  • Reference types can be self-describing types, pointer types OR interface types.
  • Variables that are reference types can refer to the same object. Therefore, operation on one variable can affect the same object referred by another variable [No copy is made].
  • All types derive from the system.object base type.
  • CTS defines every datatype as a class.


COMMON LANGUAGE SPECIFICATION [CTS]

  • CLS is a subset of CTS.
  • CLS defines a set of rules and restrictions that every language must follow which runs under the .Net framework.
  • Common language specification enables cross-language integration [inter-operability]. 
  • CLS  provides following features to the .Net framework :-
  1. Improved reliability.
  2. Increased performance.
  3. Powerful security.
  4. Integration with existing system.
  5. Mobility support.
  6. Ease of deployment
  7. Flexible data access.

MICROSOFT INTERMEDIATE LANGUAGE [MSIL]

  • The MSIL is also known as Intermediate language [IL] OR Common Intermediate language [CIL].
  • It is the lowest-level human readable programming language defined by Common language infrastructure [CLI] specification.
  • CIL is an object-oriented assembly language and is entirely stack-based.
  • MSIL OR CIL is a CPU and plate-form independent instruction set that can be executed in any environment supporting the common language run-time.
  • The execution process is:-
  1. STEP 1 :- Source code is converted into MSIL.
  2. STEP 2 :- MSIL is then assembled into a form of  byte-code.
  3. STEP 3 :- The CLR's just-in-time compiler converts the byte-code into native code.
  • MSIL code is verified for safety during run-time provides better security an reliability.
  • MSIL code has instructions for following group of tasks :-
  1. Load and store.
  2. Arithmetic.
  3. Type conversion.
  4. Object creation and manipulation.
  5. Control transfer.
  6. Method invocation and return.
  7. Throwing exceptions.