26.1 Understanding the Differences Between the Compact and .NET Frameworks

 <  Day Day Up  >  

You want to understand some of the key similarities and differences between the Compact and .NET Frameworks.


Technique

Listing every similarity between the two frameworks would be a tremendous endeavor because they have a lot in common. A lot of the information in this book works within the .NET Compact Framework. For instance, the Common Language Runtime (CLR) still uses the familiar constructs of just in time (JIT), managed code, garbage collection, and a Common Type System (CTS), which contains all the primitive types discussed in this book. The .NET Compact Framework also supports the mixing of multiple languages, although Visual C++ .NET is not included. Visual C++ users must still use the Embedded Visual Tools and unmanaged code for new devices.

Even though the .NET Compact Framework contains several similarities, a few aspects had to be either changed or removed to maintain good performance on devices that are typically slower and memory constrained. Searching in MSDN for the ".NET Compact Framework" presents a list of all the differences. Additionally, any classes, methods , and properties that are not supported in the .NET Compact Framework say so in the corresponding help documentation. Some of the main differences include the following. You cannot create multimodule assemblies in the .NET Compact Framework, but satellite assemblies for resources are still supported. COM interop is not supported. To get around this limitation, you can still use the PInvoke methods described in Chapter 21, "Securing Code," to call a DLL written in unmanaged C++ that can act as a proxy to COM objects. ADO.NET has been trimmed substantially. The System.Data.OleDb class is not supported, but a .NET Compact Framework Data Provider for SQL Server CE Edition is included.

The .NET Compact Framework supports infrared communication, whereas the .NET Framework does not. In fact, you can use a special listening class that listens for HTTP requests through the infrared port, enabling you to create a Web server for clients that connect via infrared.

Reflection is supported by the Compact Framework, but dynamically creating assemblies is not because the System.Reflection.Emit class has been removed. Also, you cannot use the equality operator to compare reflection objects such as MethodInfo , PropertyInfo , and ParameterInfo , to name a few.

Extensible Markup Language (XML) is partly supported within the .NET Framework. Some of the key items left out, however, include schema validation, which means you are unable to check the validity of an XML document and XML serialization. Furthermore, you cannot perform an XPath query on XML documents.

Comments

The differences outlined here are just a few of the many differences you'll encounter when creating a Smart Device Application. However, care was taken to only remove those items that a mobile device developer would rarely use or those items that just aren't feasible given the constraints of mobile devices. This chapter highlights the key differences and ways to address them using the .NET Compact Framework. Before you tackle any sort of large application that targets mobile devices, ensure that the technology is there to support your endeavor.

 <  Day Day Up  >  


Microsoft Visual C# .Net 2003
Microsoft Visual C *. NET 2003 development skills Daquan
ISBN: 7508427505
EAN: 2147483647
Year: 2003
Pages: 440

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