Understanding the Common Type System (CTS)


Common Type System (CTS) is a fundamental concept in the overall application programming model in .NET, allowing true interoperability with system- and user -defined data types between .NET programming languages. CTS provides language interoperability beyond what had been accomplished by COM, providing capabilities such as inheritance of a class written in one programming language by another programming language and support for exceptions and events across language boundaries. You will learn more about interoperability in Chapter 3, "Programming with .NET."

CTS defines value types and reference types:

  • Value types derive from System.ValueType; they typically use a small memory (primitives such as integers, numbers , characters , structures, enumerations, and so on) and are allocated on stack. Value types are passed by value in method calls.

  • Reference types typically abstract large amounts of data and are allocated on the managed heap. Reference types are passed by reference in method calls.

However, everything in .NET is an object deriving from System.Object, and value types can be boxed or unboxed into their corresponding heap-based objects.



Microsoft.Net Kick Start
Microsoft .NET Kick Start
ISBN: 0672325748
EAN: 2147483647
Year: 2003
Pages: 195
Authors: Hitesh Seth

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net