Core Concepts of .NET Framework 3.5

The .NET Framework 3.5 introduces significant new features and enhancements built upon the foundation of previous versions. Understanding its core concepts is crucial for developing robust and scalable applications.

Common Language Runtime (CLR)

The CLR is the execution engine of the .NET Framework. It provides essential services such as:

Base Class Library (BCL)

The BCL, also known as the Framework Class Library (FCL), is a comprehensive set of reusable, object-oriented types that can be used to develop a wide range of applications. Key namespaces include:

Intermediate Language (IL)

When you compile code written in a .NET language (like C# or VB.NET), it is compiled into Intermediate Language (IL), also known as Microsoft Intermediate Language (MSIL). This IL code is platform-independent and is later compiled into native machine code by the CLR's JIT compiler.

Benefits of IL:

  • Language Interoperability: Code written in different .NET languages can call each other seamlessly.
  • Platform Independence: IL can run on any platform that has a compatible CLR implementation.

Common Type System (CTS)

The CTS defines a set of types and operations that all .NET languages can support. This ensures that objects created by different languages can be understood and used by each other. The CLR enforces the CTS.

Common Language Specification (CLS)

The CLS is a set of guidelines that languages must follow to ensure they can interoperate with other CLS-compliant languages. Adhering to the CLS is crucial for creating libraries that can be used by developers using different .NET languages.

Application Models Introduced/Enhanced in 3.5

.NET Framework 3.5 builds upon existing models and introduces new ones:

LINQ in Action:

LINQ provides a consistent syntax for querying various data sources. For example, querying a list of numbers:

var numbers = new int[] { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
var evenNumbers = from num in numbers
                  where num % 2 == 0
                  orderby num
                  select num;

foreach (var n in evenNumbers)
{
    Console.WriteLine(n);
}

Managed Code vs. Unmanaged Code

Code that runs under the control of the CLR is called managed code. It benefits from CLR services like garbage collection and security. Code that runs directly on the operating system without CLR services is called unmanaged code (e.g., C++ applications not using the .NET Framework).

Understanding these fundamental concepts will provide a solid foundation for exploring the specific features and APIs of the .NET Framework 3.5.