Taking a Brief Look at the .NET Framework
Microsoft .NET will enable the Internet to be the basis of a new operating system. It frees you from the constraints of hardware by making user data available from the Internet. .NET is important to users because it makes their information accessible across all devices. It's also important to developers because it will change the way they develop applications by allowing them to hook into Web Services. The framework provides a foundation on which you build and run applications. This foundation allows you to build applications more easily, using a consistent component base.
This framework covers all the layers of software development above the operating system. The .NET framework actually shields you from the operating system functionality such as file handling and memory allocation. This is in preparation for the ability to develop an application that ports to a wide variety of hardware and operating system foundations.
The framework actually consists of a group of technologies that form the foundation for the .NET platform. Figure 1.3 shows the major components of the .NET framework.
Figure 1.3 The .NET Framework consists of several different components, including the Common Language Runtime.
The runtime is responsible for managing your code and providing services to it while it executes, playing a role similar to that of the Visual Basic 6.0 runtime DLL. The .NET programming languages, such as Visual Basic.NET, utilize .NET services and features through a common set of unified classes. It also allows you to deploy your Visual Basic.NET applications without worrying about dependencies in your application as you did in Visual Basic 6.
The .NET Framework and the Common Language Runtime will be discussed in greater detail on Day 4, "Understanding the .NET Framework."
Understanding the Common Language Runtime
The .NET Framework provides a runtime environment called the Common Language Runtime (CLR), which manages the execution of code and provides the services that make the development process that much easier. Code that you develop with a language compiler that targets the runtime is called managed code. Some of the benefits of the CLR are:
Cross-language exception handling
The CLR automatically handles object layout and manages all the references to those objects, including releasing them when they are no longer being used. CLR provides automatic memory management, which eliminates memory leaks as well as some other common programming errors.
The CLR makes it easy to design components and applications whose objects interact across languages. Objects written in different languages can communicate with one another, and their behaviors can be tightly integrated. For example, you can define a class, then, using a different language, derive a class from the original class or call a method on it. You can also pass an instance of a class to a method on a class written in a different language. This cross-language integration is possible because language compilers and tools that target the runtime use a common type system defined by the runtime, and they follow the runtime's rules for defining new types, as well as creating, using, persisting, and binding to types.
Visual Basic and the .NET Framework
The runtime file associated with Visual Basic 6 was great at simplifying many of the common programming tasks that you required. However, having this simplifying layer meant that you couldn't use new features in an operating system, such as DirectX, until a Visual Basicaccessible wrapper was created for it. As a Visual Basic programmer, the most important benefit you get from the .NET Framework is direct and easy access to the underlying .NET platform using a consistent programming model. This means you can build applications with Visual Basic.NET that weren't easy or possible to build with Visual Basic 6. You will appreciate having access to the same features and capabilities as other platform languages. For example, to create a Windows Service, you no longer have to know C++ to create it. You can do it all within Visual Basic.NET.