Why the .NET Compact Framework?


In Chapter 1, "Setting Up Your Development Environment," we discussed Smart Device Extensions for Visual Studio 7.1 in enough depth to create a very simple application and run it on a device. We also gained an understanding of what hardware is supported and how to deal with nonstandard devices. Now we examine the internals of the .NET Compact Framework as a platform.

Traditional compiled programming languages, such as C, C++, Pascal, and so on, use a compiler to translate source code directly into machine code understandable by the processor of the computer for which the code was compiled. Most of the time, developers were left responsible for managing low-level details, such as memory allocations and interacting with external code libraries. This includes DLL files on Windows systems. Programs could interact with the host operating system by directly calling into the operating system's API or by using one of many function libraries, such as MFC or Borland's OWL.

Portability between platforms by using native code is often difficult because the underlying operating system APIs are usually radically different. Even worse , interacting with components written in different programming languages on the same operating system is problematic because the languages use different binary representations for data structures. In short, interoperability was difficult among three major axes: across operating systems, across different CPU types running the same operating system, and across different languages on the same machine.

Until Visual Studio 7.1, developers for Pocket PC and Windows CE platforms who wanted real programming power were stuck in the compartmentalized world of traditional, or native, programming languages. With the introduction of the .NET Compact Framework, all of the problems previously described and more are solved .

Visual Studio 7.1 with Smart Device Extensions offers these important features to help devlopers write applications for Windows CE and Pocket PC devices more quickly and easily than ever before:

  • Two languages, C# and Visual Basic.NET, are supported by Smart Device Extensions out-of-the-box. Interoperability between these two languages is easy because both compile to the same bytecode format and provide access to data objects within the .NET Compact Framework.

  • Any language that targets the .NET Compact Framework can exchange objects from the .NET Compact Framework with another language that supports the .NET Compact Framework.

  • The compiled binaries for managed applications are the same, regardless of the underlying processor architecture. Developers can build an application just once and deploy it to a wide variety of Pocket PC and Windows CE hardware.

  • The .NET Compact Framework is a rich class library that provides a uniform API that developers can target from C#, Visual Basic .NET, and future languages supporting the .NET Compact Framework.

  • The .NET Compact Framework includes support for developing Windows Forms to rapidly develop compelling user interfaces.

  • The .NET Compact Framework includes a wide variety of data access classes, XML manipulation classes, a rich set of fundamental data types, easy-to-use networking support, and more.

  • The .NET Compact Framework and the associated Common Language Runtime provide garbage collection, thereby eliminating memory leak and double free bugs from your code automatically. These two bug classes are among the most time consuming, subtle, and difficult to diagnose when using native code.

  • The .NET Compact Framework provides a rich threading model without having to understand the complexities of creating threads by directly targeting the operating system.

  • Multiple versions of the .NET Compact Framework can operate side by side. Applications target the version that they know they are compatible with. This arrangement eliminates the classic "DLL Hell" problem that occurs when a DLL component is upgraded and breaks some of the applications that target a previous version of the component.

  • The .NET Compact Framework exposes a mechanism for calling into native code to help retain compatibility with legacy code and call the Windows CE operating system directly.

The rest of this book is devoted to exploring all of the power and features of the .NET Compact Framework. Whereas the previous list gives us an idea of what the .NET Compact Framework offers, drilling down to a deeper understanding of how it works helps us become more effective developers. The rest of this chapter fills in the details about how the .NET Compact Framework is designed.



Microsoft.NET Compact Framework Kick Start
Microsoft .NET Compact Framework Kick Start
ISBN: 0672325705
EAN: 2147483647
Year: 2003
Pages: 206

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