Java Reference
In-Depth Information
Framework. A program is first compiled into an executable file (that is, assembly) by the
individual higher-level language compiler, and then the executable file is fed into CLR to
be JIT-compiled into native code to be executed [Microsoft, 2012].
FIGURE 8.4 Language integration in .NET framework.
A significant advantage of the .NET Framework is cross-language interoperability, which
is supported on all versions of Windows OS, regardless of the underlying architecture.
Language interoperability means that code written in one language can interact with code
written in another language. This is made possible in .NET languages and language-specific
compilers by following a certain set of rules comprising the Common Type System (CTS).
CTS is a unified type system that supports the types found in many programming
languages, and is shared by all .NET language-specific compilers and the CLR. It is the
model that defines the rules that the CLR follows when declaring, using, and managing run-
time types. The CTS also defines casting rules (including boxing and un-boxing operations),
scopes, and assemblies. CTS supports object-oriented languages, functional languages, and
procedural programming languages. By following the rules of CTS, programmers can mix
constructs from different .NET languages, such as passing an object to a method written
in a different programming language, or defining a type in one language and deriving from
that type in another language. The types defined in CTS can be categorized as the Value
types and the Reference Types.
Value types are stored in the stack rather than the garbage-collected heap. Each value
type describes the storage that it occupies, the meanings of the bits in its representation,
and the valid operations on that representation. Value types can be either built-in data types
or user-dened types such as Enum .
Reference types are passed by reference and stored in the heap. A reference type carries
more information than a value type. It has an identity that distinguishes it from all other
objects, and it has slots that store other entities, which can be either objects or values. Ref-
erence types can be categorized as self-describing reference types, built-in reference types,
interfaces, and pointers. Self-describing types can be further categorized as arrays and class
types. The class types are user-defined classes, boxed value types, and delegates (the man-
 
Search WWH ::




Custom Search