Geeks With Blogs

News

Tim Scott All things for a good .NET geek

[I've changed the title of this entry to be more useful than 'Wednesday Summary' -- Tim]

So far, today's not been quite as dynamic and exciting as the other days.  Dunno if it's the sessions, or I'm just wearing down.

Introduction to Managed Development for Devices with Microsoft Visual Studio 2005

Presented by Neil Enns, this session covered changes in VS 2005 for mobile development.  That means SmartPhone, PocketPC, and WinCE.  Some highlights:

  • VS 2005 will support SmartPhone 2003 and later, and PocketPC 2003 and later.  It replaces eVB and eVC for these platforms.  You can do .NET 1.1 and 2.0 with VS 2005, along with unmanaged C++. There's a nice chart here.
  • They re-wrote the emulator to work in ARM mode.  Taking a clue from the Palm emulator camp, the Mobile emulator can now run actual native ARM code.  This more closely approximates the final deployment platform, as opposed to the old x86 emulator.  It can use serial ports on the host machine; and you can map a desktop folder as a storage card on the device.
  • A side note about VS 2005, when you create custom controls in the IDE, the automatically show up in the Toolbox as My Controls.  Yay!
  • They've added a visual installer designer, like VS 2003 had for the desktop apps.
  • Databases: They've added a full-featured db admin tool, much like SQL Server Manager that can work with SQL Mobile on devices.  Before this, you had to use Query Analyzer on the device itself to create your tables.
  • SQL Server Mobile is supposed to be a free redistributable.
  • C++ managed is NOT in this release, they are considering it for “V. next“

The previous session ended early, so I hopped over to .NET Framework: What's New in the Framework for Version 2.0. I'll have to get the slides, because it looked pretty interesting.  He mentioned IronPython, a python implementation for .NET 2.0; and show some demos.  Looks useful for figuring out things on the fly.

Advanced Serialization

Douglas Purdy's session covered some heavy duty internals of serialization in .NET.  Serialization is the transformation of an object graph into some other format. This object graph can be instances or types.  This is an important distinction, as we'll see later. Serialization in .NET can be one of several transformations:

  • XSD -> CLR : This is hard, they've implemented most of it in VS 2005.  It is hard, because mapping from all possible XSD schemas to code is, well, hard.  Representations are not 1:1.
  • CLR - > XSD: Pretty easy.  Take a type and generate the schema for it.  Currently implemented.
  • CLR -> CLR: Easy.  Done now.

There are three actual classes (or components) that do serialization: XML serialization, SOAP formatter and Binary formatter.  Why three different approaches?  Three different teams needed serialization during the initial development of .NET, so they each wrote their own.  They will be unified in one model soon, Indigo

THEN, we learned about something, well, embarrassing about .NET 1.1. Apparently, the first time you serialize or deserialize a class in .NET 1.1, the following happens:

  • The framework examines the type with reflection, to figure out how to serialize it.
  • From this, it generates a C# class file that knows how to serialize it.
  • That string representation of a c# class is dumped out to a file, and compiled with CSC.exe.
  • That assembly is then used to serialize the object.

No wonder Xml Serialization is so slow!  I haven't verified this yet to make sure that I haven't misunderstood something.  But he did tell us about a way you can get around it: http://www.sellsbrothers.com/tools/#XmlSerializerPreCompiler This tool uses the app.config key XmlSerialization.Compilation, set it to value 4 to keep the temp files around after the program is through with them. You can import these .cs files into your project, and have a class that knows how to serialize your file w/o reflection.  The only problem is that these have to be updated every time your object model changes. For info, google for “XmlSerialization.compilation“ or “XmlSerializerPreCompiler“  VS 2005 will come with Sgen, a tool that addresses this problem.

The binary formatter is the “way of the future.”  It's the way Indigo does it.  But, XmlSerialization is not going away soon, and will be compatible with Indigo.  There was some more stuff, but it gets a bit technical. Ask me if you are interested about serialization in .NET.

Power Tips and Tricks for Windows Mobile Device Designers

Larry Lieberman talked about some useful tools in VS 2005 for mobile development:

  • Remote display tool: Lets you view and control a remote mobile device from your desktop. (Mobile meaning SmartPhone, Windows CE, or PocketPC).
  • DCS Tool: A way to setup configuration and debugging options on a mobile device through the command line
  • A phone call and SMS simulator for the emulator: Lets you test apps that work with SMS or phone calls w/o an actual device.
  • System.Diagnostics has been added to the .NETcf
  • You can attach to a remote device and do debugging (like desktop has had)
  • PocketWatson will now dump out debug files that you can load in the IDE and step through the code after the fact.

Most of these tools work for both unmanaged and managed development on mobile devices. 

That was it for the classes.

Posted on Wednesday, June 8, 2005 6:22 PM TechEd | Back to top


Comments on this post: Mobile Dev and Serialization

# re: Mobile Dev and Serialization
Requesting Gravatar...
Can i Use Sqi Server Mobile With VisulStudio 2003???

Left by Rao M S on Dec 13, 2005 8:34 PM

Your comment:
 (will show your gravatar)


Copyright © Tim Scott | Powered by: GeeksWithBlogs.net