Critical Development

Language design, framework development, UI design, robotics and more.

Archive for January, 2008

The Architecture Journal: Mobile Architecture

Posted by Dan Vanderboom on January 14, 2008

One of my favorite journals is The Architecture Journal: Input for Better Outcomes, published by Microsoft.  I can usually count on it for in-depth, high-level articles about current technologies and design practices, and I was excited to see an issue devoted to one of my favorite topics: mobile architecture.  Although it now requires a Live ID registration, it’s free, and I highly recommend that you take advantage of it.  In fact, you should even go back and read the old issues.  (There’s a cool beta of a reader for this journal that you can download here.)

That being said, I have to admit I’m rather disappointed with this particular issue.  Though I understand that not all mobile solutions will run on Windows CE or Windows Mobile devices, that UMPCs and tablets are considered part of the same market, still… broad remarks are made that don’t even hint at current limitations in the technology—information that architects considering mobile projects would find useful to know.

For example, the first article advocates the use of Microsoft Synchronization Services (“which lets application developers easily add synchronization…”), but fails to mention that it doesn’t support Windows CE or Windows Mobile at all (and who knows when it ever will, or how crippled it will be when it is finally supported?).

The article on extending enterprise applications to mobile devices touched on most of the same issues that I’ve run into over the past several years, but is so narrowly focused on a singular strategy and implementation that I felt it failed to present a more useful, and more abstract, treatment of the issues that could be appreciated and applied in vastly different scenarios.  The long lists of best practices such as “use database stored procedures to write wrapper code for faster data access” represents, I believe, one philosophy of data management in general, and is not wholly relevant to the topic of mobility and its specific ramifications.  What of the update statement that gets executed only a dozen times daily: will 20 milliseconds of faster execution time be worth the accumulated hours of maintenance and updating of those extra database objects as the product evolves?  How many development assets do you want to manage, if you can use an ORM solution like LINQ without incurring that overhead?

Likewise, recommendations to include a history table for every regular table, where you do only inserts and never updates based on triggers, begs the question of “where the hell do you get all of this storage space on your mobile devices that you can be so wasteful?”  You’re really going to make a copy of records from multiple tables when a single row in one of the table is updated in any way?  Every time?

While the article on Test Driven Development and Continuous Integration for Mobile Applications was one of my favorites (the other being an article on automotive applications), the author mentions his open source project which provides automated testing for mobile devices.  Is this solution necessary now that Visual Studio 2008 supports automated tests for mobile devices?  Isn’t this guy rather late in announcing this project?  (I don’t know, as I’ve only toyed with VS2008’s mobile testing a little and am not aware of its shortcomings.)  He also mentions his appreciation for the release of Compact Framework v2.0, so either this article was written a while back (and is now stale), or this guy doesn’t realize that v3.5 has been out for a couple months now, with betas and CTPs going further back.

When I read an architecture journal, I expect deep, insightful, relevant, up-to-date material by those who preferably have implemented more than one system, and have learned valuable lessons in different contexts that they want to distill into wisdom and share with the community.  Where I have been impressed with past issues, I believe this one has fallen short.  Maybe I’m extra-critical because of my familiarity with the subject.  You be the judge.

But I still look forward to the next issue.  And it encourages me to start jotting down some ideas for future articles of my own.  What are the real gotchas in mobile development?  If we had a map of these pitfalls, and the corresponding opportunities…

To be continued.

Posted in Compact Framework, Problem Modeling, Software Architecture, Windows Mobile | Leave a Comment »

Invention-A-Day: List Control Builder

Posted by Dan Vanderboom on January 6, 2008

I spent a few hours yesterday playing in WPF again, this time with data binding and list controls.  Every time I work with WPF, I get more excited, and am more impressed by what’s possible there.  I work with Windows Forms on mobile devices for a living, and list controls is one area that always seems to be lacking something.  I’ve used Resco’s AdvancedList for several years, and find that I can get it to do almost anything within reason in Windows Forms, but the API leaves a lot to be desired: it is unintuitive in several ways.

I’ve looked through the source code for several list controls, and they are complicated beasts.  Almost too complicated, I think, to be packaged up as a whole and delivered atomically as they are (though one can hardly blame them for delivering a complete solution).

Regardless of whether we’re talking WPF or Windows Forms (though I think WPF would support it much more easily), my invention is a list control system in which one can select options and write new components for different aspects or components within it.  With this list control builder, I would like to select a paging mechanism (virtualized, all-in-memory), a scrolling mechanism (scrollbars, grab-and-pull, accelerated-tug), a selecting mechanism (single, multiple, selection by selecting a control or double-tapping), a display style, and so on.  A wizard could guide the developer through the list’s creation, and the resulting configuration and behavior could then be saved as either a new style, or a generated control assembly, to appear in the toolbox as a new control.

Posted in Invention-A-Day, User Interface Design, Visual Studio | Leave a Comment »

Invention-A-Day: Visual Studio Virtual Asset Collection

Posted by Dan Vanderboom on January 6, 2008

One of the challenges of managing several large Visual Studio solutions with many shared projects is that related assets aren’t always located in the same place.  I use a querying system that inserts many queries inside rows of a table on the server.  This allows us to change synchronization queries without having to recompile the application.  These are loaded into the database through a database-building application.  Then we have template definitions for list controls which are loaded on handheld devices in a separate solution, and therefore a separate instance of Visual Studio.  Then there’s code to establish the data bindings, which is located elsewhere, and a few other pieces are spread here and there.  The result is that when I need to create a new list of data, I have to go to several different places to set it up.  I’m constantly jumping between instances of Visual Studio, different projects, editing template XML files and SQL queries and code files, etc.  And I keep thinking it would be nice to have all of this stuff in one place, at least for the purpose of creating and editing during development, even if they get distributed across several assemblies.

I use a file explorer tool called Directory Opus, which has the ability of defining “Collections”.  You can add files and folders to these named collections, and even though they’re spread across many different locations, you can access them all in one spot.

So here’s my invention today: a tool window in Visual Studio where you can define your own named collections, into which you can drag and drop items from Solution Explorer, or from files in other solutions.  Or better yet, a replacement for Solution Explorer that has this ability integrated into it.  Then in one place, I could see my list control templates, the queries that populate the list, the code for the workflow logic that uses it, both the view and its presenter (or controller) in an MVC/MVP pattern, images used in the list, and so on.

Posted in Invention-A-Day, User Interface Design, Visual Studio | Leave a Comment »

Visual Studio Goodie: Transparentize Intellisense

Posted by Dan Vanderboom on January 6, 2008

Once in a while, I discover (or am shown) a keyboard shortcut or other hidden gem inside Visual Studio that I never knew was there.  I’ve always been slightly annoyed with Intellisense because I often need some information on the line or two below where the cursor is, which gets obscured by the Intellisense window.  I thought I had to cancel out of Intellisense, look at the data, re-trigger the Intellisense, and sometimes repeat this once or twice more before completing the statement that I was writing.

But there’s a simple way around this.  When Intellisense is active (and obscuring several lines of code), just press and hold the Control key on your keyboard.  Your Intellisense window will become something like 95% transparent.  You can then read what’s under it, release the Control key, and you won’t even lose your position in the Intellisense window!

Very simple, but also very helpful!  Makes me want to look for other handy shortcuts…

Posted in Visual Studio | Leave a Comment »

Remote SQL Server Compact Queries: Fun with VS2008 & ActiveSync

Posted by Dan Vanderboom on January 5, 2008

I wanted to show you how to use Server Explorer to connect to an ActiveSync-connected Windows Mobile device in order to write queries against a SQL Server Mobile/Compact database, so that I can demonstrate all of the problems I’ve had with that tool, the error messages I’ve encountered, and to explain just why I’ve chosen to write a replacement for it.  However, a funny thing happened on the way to the forum…

Trouble at the Start

In setting up for writing this query, I intended to use the emulator, but quickly realized that creating an ActiveSync connection to it presented some difficulties.  In an older version of the Windows Mobile Developer Power Toys, there was a driver that supported ActiveSync connections to an emulator device (which can be found here), but this was targeted for Visual Studio 2003.  When I tried installing it to see if it would work on VS2008, I first got a nasty warning that the publisher couldn’t be verified (isn’t it Microsoft?), and then was told that Vista was rejecting it due to incompatibility.  The new v3.5 of the Power Toys does not include this driver.  Bummer.

Not knowing where my Symbol MC50 is at the moment, I decided to use my WM5 cell phone (an AT&T 8525).  With the restrictive security blocking my attempt to deploy and debug from Visual Studio, I had to use the Device Security Manager (under the Tools menu), which is a very handy tool.  After connecting to the device (after several spontaneous network hiccups), I selected “Security Off”, right-clicked on the connected device, and chose Deploy.  After that, I was able to deploy and debug on the device wirelessly.

A good start, but next I needed to connect via ActiveSync.  I plugged in the USB cable between my cell phone and PC, and nothing happened.  I tried all of the USB ports, rebooted my cell phone and laptop, made sure Windows Mobile Device Center was running on the PC and the ActiveSync window was running on the mobile device, I pressed the “Sync” menu button on the device, … but nothing happens.  It’s “Waiting for network” supposedly.  I’ve gotten ActiveSync to work with my cell phone many times in the past (though not consistently).

I also tried using the Device Emulator Manager, shown below.  If you right-click, you get a context menu with an option to Cradle, which I hoped would trigger an ActiveSync, but it doesn’t.  Either it’s just not supported, or ActiveSync is angry with my device for some reason.


To Be Continued…

This is typical of the kind of behavior that has given me the opinion that ActiveSync is a piece of junk, and any tool or technology built on top of it will be susceptible of the same unreliability.  I’m very busy and have a lot to get done in a short period of time, and mobile device development is already inherently complicated and slow compared to desktop development.  I just don’t have time to fight with the tools like this.

I will find another device, get it to ActiveSync, and then return to this topic in a future article to demonstrate the remote query tool inside VS2008.  Then I’ll get back to solving the problem with my new product.

Posted in Compact Framework, SQL Server Compact, Visual Studio | Leave a Comment »