|
Development | .NET Compact Framework
.NET Compact Framework - Making the Switch!
Written by Derek Mitchell
[author's bio]
[read 48465 times]
Edited by Derek
Page 1
Page 2
Page 3
I've been working with the beta version
of the .NET Compact Framework (.NET cf) for a while now
and I thought it was high time to try and distill some of
those experiences, hopefully making the experience of switching
from eVB to .NET a little bit easier. The latest
poll on DEVBUZZ indicates that a large number of you
are converting so here goes - hopefully we can avoid mentioning
polymorphism more than once (catch
done!). I'm also writing this for the traditional VB developer
wanting to get into .NET cf. Having never been a hard core
C programmer of any obvious talent myself, this article
is definitely skewed towards the above audience. As a VB
programmer I have unpleasant memories of methodologies attempting
to encapsulate object orientated (OO) using an architecture
patently unsuited to it. Thankfully the arrival of .NET
CF has changed all that!
.NET Compact Framework who?
The
.NET Compact Framework (.NET CF) is a subset of the full
version of the .NET Framework - the MS suite of development
tools and services - the next generation of Windows development
if you will. The .NET CF subset of functionality
targets the Pocket PC specification and as such the goal
is that it only implements that functionality best suited
to a device with limited CPU power, memory and bandwidth
connectivity. If you have been doing any VB.NET programming
for the desktop you will notice some omissions in .NET CF
- just remember the goal here is to get the memory footprint
of the .NET CF to a reasonable size. Currently it is around
2 MB and the final footprint will hopefully be around 1.5
MB - perfectly reasonable for devices with 32-64 MB of memory.
The most notable omissions are the Treeview and grid controls
- but never fear that will be remedied in time. To see the
differences between the full API and the Compact Framework
there is an invaluable help file on GOTDOTNET here.
Getting Started
To start with the .NET CF you will need
a copy of Visual Studio .NET and the Smart Device Extensions.
The Smart Device Extensions "extends" VS.NET so
that you can develop against .NET CF target platforms. Currently
since the .NET CF is in beta you can only get the Smart
Device Extensions via an MSDN subscription or by applying
here
(this may be closed by the time you read this). Interestingly
the .NET CF runtimes for the devices are available here.
So hurry out buy a new Pocket PC 2002, install ActiveSync,
download the Pocket
PC 2002 SDK (cable modem friendly users only), install
VS.NET, the Smart Device Extensions and you will be well
on your way to being a legend in your own lunch hour!
A word about namespaces
.NET is all about namespaces. To fully
understand the .NET you need to know that the most fundamental
structure in a .NET application is the .NET Assembly. One
of the issues with the old COM model is that the COM component
information was stored in both the registry as well as a
type library file (usually distributed with the component).
The new .NET executable embraces a simpler and more elegant
solution by storing the metadata ("data about data")
of the physical executable within the actual executable
itself. This new approach has imposed a new structure on
the way that the Windows executables are now packaged, the
Assembly. This is what is meant by .NET evangelists when
they say that .NET applications are self-describing. It
is important to note thought that this does not imply that
an Assembly is one physical file - DLL's and EXE's still
exist they are just no longer the definitive elements of
a Windows application. So where do namespaces fit in, this
is as clear as mud you say? Well, and this is where the
beauty of .NET starts to reveal itself, the .NET runtime
classes defines a set of data, methods and functionality
that you develop against for user interface, data and messaging
operations - "your programming". These .NET classes
are organized in to a structure of "namespaces"
- hierarchical and nested groupings of common functionality.
As the developer your most significant challenge is now
not so much a case of "can it be done?" and more
a situation of which namespace shows me how to do it. Perhaps
I'm getting carried away here but at least that is the way
it feels. There are over currently over 3500 namespaces
in about 100 .NET classes so make a shortcut to your .NET
help file.
A practical example of using a namespace
- want to access the VB constants? Import the Microsoft.VisualBasic.ControlChars
namespace then simply type in ControlChars in VS.NET
and let Intellisense do the rest. You will be able to access
all the constants such as ControlChars.Tab and ControlChars.NewLine
etc.
Now let's move on to some helpful tips...
Next
Page
Back to .NET Compact Framework | [Article Index]
|