Tuesday, October 14, 2008

"ETL"ing Source Code

The past couple weeks, I've been between projects, which has gotten me involved in a number of "odd jobs". An interesting pattern that I'm seeing in them is querying and joining, and updating data from very traditionally "unlikely" sources... especially code.

SQL databases are very involved, but I find myself querying system views of the schema itself, rather than its contents. In fact, I'm doing so much of this, that I'm finding myself building skeleton databases... no data, just schema, stored procs, and supporting structures.

I'm also pulling and updating metadata from the likes of SharePoint sites, SSRS RDL files, SSIS packages... and most recently, CLR objects that were serialized and persisted to a file. Rather than outputting in the form of reports, in some cases, I'm outputting in the form of more source code.

I've already blogged a bit about pulling SharePoint lists into ADO.NET DataSet's. I'll post about some of the other fun stuff I've been hacking at soon.

I think the interesting part is how relatively easy it's becoming to write code to "ETL" source code.

Tuesday, September 30, 2008

Reading SharePoint Lists into an ADO.Net DataTable

[Feb 18, 2009: I've posted an update to show the newer technique suggested below by Kirk Evans, also compensating for some column naming issues.]

The other day, I needed to write some code that processed data from a SharePoint list. The list was hosted on a remote MOSS 2007 server.

Given more time, I'd have gone digging for an ADO.NET adapter, but I found some code that helped. Unfortunately, the code I found didn't quite seem to work for my needs. Out of the box, the code missed several columns for no apparent reason.

Here's my tweak to the solution:

(The ListWebService points to a web service like http://SiteHost/SiteParent/Site/_vti_bin/lists.asmx?WSDL )

private data.DataTable GetDataTableFromWSS(string listName)


ListWebService.Lists lists = new ListWebService.Lists();

lists.UseDefaultCredentials = true;

lists.Proxy = null;

//you have to pass the List Name here

XmlNode ListCollectionNode = lists.GetListCollection();

XmlElement List = (XmlElement)ListCollectionNode.SelectSingleNode(String.Format("wss:List[@Title='{0}']", listName), NameSpaceMgr);

if (List == null)


throw new ArgumentException(String.Format("The list '{0}' could not be found in the site '{1}'", listName, lists.Url));


string TechListName = List.GetAttribute("Name");

data.DataTable result = new data.DataTable("list");

XmlNode ListInfoNode = lists.GetList(TechListName);

System.Text.StringBuilder fieldRefs = new System.Text.StringBuilder();

System.Collections.Hashtable DisplayNames = new System.Collections.Hashtable();

foreach (XmlElement Field in ListInfoNode.SelectNodes("wss:Fields/wss:Field", NameSpaceMgr))


string FieldName = Field.GetAttribute("Name");

string FieldDisplayName = Field.GetAttribute("DisplayName");

if (result.Columns.Contains(FieldDisplayName))


FieldDisplayName = FieldDisplayName + " (" + FieldName + ")";


result.Columns.Add(FieldDisplayName, TypeFromField(Field));

fieldRefs.AppendFormat("", FieldName);

DisplayNames.Add(FieldDisplayName, FieldName);


result.Columns.Add("XmlElement", typeof(XmlElement));

XmlElement fields = ListInfoNode.OwnerDocument.CreateElement("ViewFields");

fields.InnerXml = fieldRefs.ToString();

XmlNode ItemsNode = lists.GetListItems(TechListName, null, null, fields, "10000", null, null);

// Lookup fields always start with the numeric ID, then ;# and then the string representation.

// We are normally only interested in the name, so we strip the ID.

System.Text.RegularExpressions.Regex CheckLookup = new System.Text.RegularExpressions.Regex("^\\d+;#");

foreach (XmlElement Item in ItemsNode.SelectNodes("rs:data/z:row", NameSpaceMgr))


data.DataRow newRow = result.NewRow();

foreach (data.DataColumn col in result.Columns)


if (Item.HasAttribute("ows_" + (string)DisplayNames[col.ColumnName]))


string val = Item.GetAttribute("ows_" + (string)DisplayNames[col.ColumnName]);

if (CheckLookup.IsMatch((string)val))


string valString = val as String;

val = valString.Substring(valString.IndexOf("#") + 1);


// Assigning a string to a field that expects numbers or

// datetime values will implicitly convert them

newRow[col] = val;



newRow["XmlElement"] = Item;



return result;


// The following Function is used to Get Namespaces

private static XmlNamespaceManager _nsmgr;

private static XmlNamespaceManager NameSpaceMgr




if (_nsmgr == null)


_nsmgr = new XmlNamespaceManager(new NameTable());

_nsmgr.AddNamespace("wss", "http://schemas.microsoft.com/sharepoint/soap/");

_nsmgr.AddNamespace("s", "uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882");

_nsmgr.AddNamespace("dt", "uuid:C2F41010-65B3-11d1-A29F-00AA00C14882");

_nsmgr.AddNamespace("rs", "urn:schemas-microsoft-com:rowset");

_nsmgr.AddNamespace("z", "#RowsetSchema");


return _nsmgr;



private Type TypeFromField(XmlElement field)


switch (field.GetAttribute("Type"))


case "DateTime":

return typeof(DateTime);

case "Integer":

return typeof(int);

case "Number":

return typeof(float);


return typeof(string);



Thursday, September 25, 2008

The Great Commandment

While I was writing a post the other day, I noticed that I had neglected a topic that I find very important in software development. Risk management.

There are only a few guarantees in life. One of them is risk. Companies profit by seizing the opportunities that risks afford. Of course, they suffer loss by incidents of unmitigated risks. All our government and social systems are devices of risk management. In business, risk management is (now, and ever shall be) the great commandment.

Many software engineers forget that risk management is not just for PM’s. In fact, software and its development is fundamentally a tool of business, and, by extension, risk management. The practice of risk management in software really extends in to every expression in every line of source code.

Don’t believe me? Think of it this way… If it wasn’t a risk, it would be implemented as hardware. I've often heard hardware engineers say that anything that can be done in software can be done in hardware, and it will run faster. Usually, if a solution is some of the following…
· mature,
· ubiquitous,
· standard,
· well-known,
· fundamentally integral to its working environment

…it is probably low risk, particularly for change. It can likely be cost-effectively cast in stone (or silicone). (And there are plenty of examples of that… It’s what ASIC’s are all about.)

Software, on the other hand, is not usually so much of any of those things. Typically, it involves solutions which are…
· proprietary,
· highly customized,
· integration points,
· inconsistently deployed,
· relatively complex / error-prone
· immature or still evolving

These are all risk indicators for change. I don’t care what IT guys say… software is much easier to change than logic gates on silicone.

I’ve dug in to this in the past, and will dig in more on this in future posts, but when I refer to the “great commandment”, this is what I mean.

Application Platform Infrastructure Optimization

In doing some research for a client on workflow in SharePoint, I came across this interesting article about the differences between BizTalk 2006 and the .NET Workflow Foundation (WF).

The article itself was worth the read for its main point, but I was also interested in Microsoft's Application Platform Infrastructure Optimization ("APIO") model.

The "dynamic" level of the APIO model describes the kind of system that I believe the .NET platform has been aiming at since 3.0.

I've been eyeing the tools... between MS's initiatives, my co-workers' project abstracts, and the types of work that's coming down the pike in consulting. From the timing of MS's releases, and the feature sets thereof, I should have known that the webinars they've released on the topic have been around for just over a year.

This also plays into Microsoft Oslo. I have suspected that Windows Workflow Foundation, or some derivative thereof, is at the heart of the modeling paradigm that Oslo is based on.

All this stuff feeds into a hypothesis I've mentioned before that I call "metaware", a metadata layer on top of software. I think it's a different shade of good old CASE... because, as we all know... "CASE is dead... Long live CASE!"

Monday, September 15, 2008


I've been avoiding the whole My Space / Facebook thing for a while now... but now I'm checking it out. A little part of me is afraid that a public ill-prepared for the communications onslaught of web 2.0 toys like Facebook will fall prey to it. It may lead to implants that allow people to have every thought cataloged for later analysis. Before you know it, we'll all be Assimilated! (Resistance is Futile!)

Sunday, September 14, 2008

Champions of Disruption

I've been noticing lately that truely interesting things only happen on the "edge". Everything is energy, and everything happens at the point where energy flows are disrupted.

If you don't believe me, just ask Mother Nature. Take solar energy. Powerful energy flows from our sun and saturates our solar system... but all the amazing things happen where that energy flow is disrupted. The Earth disrupts it, and the result, in this case, is merely life as we know it.

It's so primal that we've abstracted the concept of energy flows, and call it (among other things) currency. When we sell a resource (a form of energy, in a sense), we even call that change "liquidation".

Sure, potential energy has value, but there are no edges in a region of potential energy. Potential energy is usually static, consistent, and only really exciting for what it could do or become, rather than what it currently is.

Likewise, it's where disruptions occur that there's business to be done.

According to this article on Information Week, CIO/CTO's appear to have generally become change-averse order takers. Surveys cited indicate that many shops are not actively engaged in strategy or business process innovation.

Perhaps they're still feeling whipped by the whole "IT / Business Alignment" malignment. Maybe they're afraid of having business process innovation through technology innovation come off as an attempt to drive the business. Ultimately, it seems many are going into survival mode, setting opportunity for change asside in favor of simply maintaining the business.

Maybe the real challenge for IT is to help business figure out that innovation is change, and change is where the action is.

In any case, it seems there's a lot of potential energy building up out there.

The disruptions must come. Will you be a witness, a victim, or a champion of them?

Saturday, September 13, 2008

Retail IT in the Enterprise

Lately, the projects I've been on have had me taking on roles outside my comfort zone. (I'm not talking about downtown-Boston... with the "Boston Express" out of Nashua, I'm ok with that.)

I've always been most comfortable, myself, in cross-discipline engineering roles, especially in smaller teams where everyone's got good cross-discipline experience. The communications overhead is low. The integration friction is low. Everyone knows how it needs to be done, and people are busy building rather than negotiating aggressively.

These types of tight, focused teams have always had business focused folks who took on the role of principal consultant. In this type of situation, the principal consultant provides an insulation boundary between the technical team and the customer.

This insulation has made me comfortable in that "zone": I'm a technologist. I eat, sleep, dream software development. I take the ability to communicate complex technical concepts with my peers effectively and concisely, very seriously.

So like I said, lately the projects I've been on have yanked me pretty hard out of that zone. I've been called on to communicate directly with my customers. I've been handling item-level projects, and it's a different world. There is no insulation. I'm filling all my technical roles, plus doing light BA and even PM duty.

Somewhat recently, I emailed a solution description to a CFO. The response: "Send this again in user-level English."

It killed me.

I've gotten so used to having others "protect" me from this sort of non-technical blunder. In contemporary projects, the insulating consulting roles are simply not present.

Makes me wonder about the most important lessons I learned during my school days... In high school days, maybe it was retail courtesy, and retail salesmanship in a technical atmosphere ("Radio Shack 101"). In college days, the key lessons might have been how to courteously negotiate customer experience levels, (from "help desk 101").

Wednesday, September 10, 2008

Compact and Full .NET Frameworks

One of the things I've been intrigued by for a while now is the fact that code compiled for the .NET Compact Framework (all versions) executes very nicely on the full .NET Framework.

For example, my personal hobby project, "Jimmy Sudoku", is written in C# for the .NET Compact Framework 2.0. There are actually two install kits. The first is a .CAB file for Windows Mobile devices. The second is an .MSI for Windows 9x, XP, and Vista. The desktop install kit even serves two purposes. First, it installs the program on the desktop. Second, it leverages ActiveSync to push the .CAB up to the Windows Mobile device.

It's a .NET Compact Framework app especially for Windows Mobile devices, but many 'Jimmy' fans don't have a Windows Mobile device to run it on.

The coolest part is the ease in which all of the components inter-operate. The .EXE and .DLL's that are delivered to the mobile device are the very same as the ones that are delivered to the desktop. Like Silverlight to WPF, the Compact Framework is a compatible subset of the full framework, so interoperability is a given.

Even better, you can reference CF assemblies in Full framework assemblies. One immediate offshoot of this in my hobby project... the web service I built to service "Game of the Day" requests actually references the CF assembly that implements the game state model and game generator code. The assembly that generates games on Windows Mobile PDA's & cell phones is the very same assembly that generates games in the ASP.NET web service.

Admittedly, there are some bothersome differences between the CF and the Full .NET Framework. The CF does not support WPF. The CF has no facilities for printing. Also, while the CF does supports some of the common Windows Forms dialogs, it does not support File Save and File Open dialogs on Windows Mobile Standard Edition (Smart Phone / non-touchscreen) devices.

These differences can be overlooked to some extent, though, for the fact that one compiled assembly can execute on so many very different machine types. Further, with interoperability, one can extend a CF-based core code with full-framework support. For example, I'm currently playing with desktop print functionality for my hobby project.

Something that I'd really love to see, some day, is a good excuse to develop a Windows Forms app for a client that had shared components between the desktop and a mobile.

I can imagine that this model would be superb for a huge variety of applications, allowing a fully featured UI for the desktop version, and an excellent, 100% compatible, very low risk (almost "free") portable version.

I've often thought this would work great for apps that interface hardware, like:
field equipment,
mobile equipment,
vehicles of all sorts,

...simply plug in your PDA (via USB or Bluetooth), and it becomes a smart management device for the equipment, using the very same code that also runs on the desktop.

Thursday, September 4, 2008

Semi-IT / Semi-Agile

While working on-site for a client, I noticed something interesting. On the walls of some of my client's "users" offices, along with other more classic credentials, are certifications from Microsoft... SQL Server 2005 query language certifications.

I've heard a lot about the lines between IT and business blurring. We talk a fair amount about it back at HQ.

Interestingly, this case is a clear mid-tier layer between classic IT (app development, data management, advanced reporting) and business in the form of ad hoc SQL querying and cube analysis. In many ways, it's simply a "power-user" layer.

The most interesting part about it is the certification, itself. The credentials that used to qualify an IT role are now being used to qualify non-IT roles.

Another trend I'm seeing is development ceremony expectations varying depending on the risk of the project. Projects that are higher risk are expected to proceed more like a waterfall ceremony. Lower risk projects proceed with more neo-"agility".

The project I was on was apparently considered "medium" risk. The way I saw this play out was that all of the documentation of a classic waterfall methodology was expected, but the implementation was expected to develop along with the documentation.

In many ways, it was prototyping into production. Interestingly, this project required this approach: the business users simply did not have time to approach it in a full waterfall fashion. Had we been forced into a full-fledged classic waterfall methodology, we might still be waiting to begin implementation, rather than finishing UAT.

Power and Control: Fusion Report 13 June 008

Power and Control: Fusion Report 13 June 008

Thanks for the report, M. Simon. My post about Energy Productization was actually a bit of a response to an article I read that covered both the WB7 and ITER. Your report hits the points much more concisely.

Tuesday, September 2, 2008

Energy Productization

I think the ITER project, a grand-scale fusion project, is interesting. I'm troubled with it for a few reasons, though. I can't help but think that there's only a few reasons that we need it, and most of them have to do with power... of a controlling nature.

There's already a great big huge fusion reactor throwing more energy at us than we can collect, let alone use... every single day... the sun.

Efforts to create fusion reactors here on earth are great for these reasons:
1) Energy for space exploration
2) Productization of energy
3) Weapons innovation

Once we learn how fusion's done, we can build space craft from it that could potentially get us somewhere in the galaxy. That's all well and good, but will it happen before we poison our existing biosphere?

Once we have fusion reactors, energy moguls can sell it. Oh, great! Instead of energy productization through oil, we get energy productization through fusion... because we can't all have one of these great big huge reactors in our basements. At least it's renewable. If the moguls are benevolent, it might even be cheap.

Finally, once we have fusion reactors like this, we'll learn new ways to blow ourselves out of our collective misery... so I suppose the first two points are mute once this comes along.

Monday, September 1, 2008

Economic Detox

While contemporary headlines bode poorly for the U.S. economy, I see them as signs of hope...

I keep hearing high-pitched alarms about the weakening U.S. dollar, inflation, energy prices, the housing market bubble burst. We all see the ugly face of the these conditions.

Global trade has been a bitter (but necessary) pill for the U.S. Perhaps the Clinton-detonated U.S. economic nuclear winter (of global trade, NAFTA, etc.) is finally starting to give way to a new economic springtime in the States.

In the late 90's US market, there were a lot of excesses in the technology sector. Then the bubble burst. When the dust settled, we (the US IT industry) found ourselves disenfranchised by our sponsors... corporate America beat us with our own job hopping. U.S. Engineers hopped off to the coolest new startup, and rode their high salaries into the dirt, while enduring companies went lean, mean, and foreign. We had become so expensive, we were sucking our own project ROI's completely out of sight. By hooking foreign talent pools, the ROI's were visible again.

Nearly a decade later, look what's happening around the world... Many foreign IT job markets are falling into the same salary inflation trap that the U.S. market fell into... They are going through the same inflation we experienced. Their prices are rising.

Combine their salary inflation with our salary stagnation and a weakening dollar, and what do you get?

A leaner, meaner domestic competitor.

In a sense, it's like that in many sectors of the U.S. economy.

So let the U.S. dollar weaken... It means that America can go back to being product producers (rather than mindless consumers) in the global market!

Saturday, August 30, 2008

If It Looks Like Crap...

It never ceases to amaze me what a difference "presentation" makes.

Pizza Hut is airing a commercial around here about their "Tuscani" menu. In the commercial, they show people doing the old "Surprise! Your coffee is Folgers Crystals!" trick in a fancy restaurant, except they're serving Pizza Hut food in an "Olive Garden"-style venue.

It clearly shows my point, and that the point applies to anything... books, food, appliances, vehicles, and software, just to name the first few things that pop to mind. You can have the greatest product in the world... it exceeds expectations in every functional way... but any adjective that is instantly applied to the visual presentation (including the environment it's presented in) will be applied to the content.

If it looks like crap, that's what people will think of it.

(Of course, there are two sides to the coin... What really kills me are the times when a really polished application really IS crap... it's UI is very appealing, but not thought out. It crashes at every click. But it looks BEAUTIFUL. And so people love it, at least enough to be sucked into buying it.)

Good engineers don't go for the adage "It's better to look good than to be good." We know far better than that. You can't judge the power of a car by its steering wheel. Granite countertops look great, but they're typically hard to keep sanitary.

When it comes to application user interfaces, engineers tend to make it function great... it gives you the ability to control every nuance of the solution without allowing invalid input... but if it looks kludgy, cheap, complex, or gives hard-to-resolve error messages, you get those adjectives applied to the whole system.

So what I'm talking about, really, is a risk... and it's a significant risk to any project. For that reason, appearance litterally becomes a business risk.

For any non-trivial application, a significant risk is end-user rejection. The application can do exactly what it's designed to do, but if it is not presented well in the UI, the user will typically tend to reject the application sumarily.

That's one thing that I was always happy about with the ISIS project. (I've blogged about our use of XAML and WPF tools in it, before.) The project was solid, AND it presented well. Part of it was that the users loved the interface. Using Windows Presentation Foundation, it was easy to add just enough chrome to impress the customers without adding undo complexity.

Monday, August 25, 2008

I blew it...

While working on the site, I accidentally deleted a core portion of the Jimmy Sudoku 2.5 puzzle generator web service. (Don't ask me how... it was apparently so bone-headed that it took me a while to realize I'd done it.)

I've exhausted all my backup options... the backups were either too new (and therefore producing the wrong content format), or so old that the backup itself was corrupt.

The good news is 2.5 supported local game generation if the service was on the fritz. I guess that means its covered.

Anyway, if you send me proof of purchase of any rev prior to 3.0, I'll send the fresh bits along.

Send it to me in email to jimmysoftware (at) kataire.com, and I'll reply with a copy. (Your order number & date will probably suffice...)

Sunday, August 17, 2008

Compromise & Capitulation

There's three different flavors of Windows Mobile in the 6.x line. Standard, Classic, and Professional.

Standard = Smart Phone, no touchscreen
Classic = PDA w/touchscreen
Professional = PDA / Phone with Touchscreen

One of the other interesting little gotchas is that the .Net Compact Framework 2.0 compiles the same for all three editions. Unfortunately, once in a while, you get a "NotSupportedException" out of the Standard edition.

A few days ago, in order to get my sudoku program published, I decided to simply avoid a problem I had with the Standard edition's lack of a SaveFileDialog and OpenFileDialog. My avoidance manifested in a "not supported" message of my own, if the user tried to save / load a file in that environment.

Today, I capitulated... I implemented an alternative file save/load functionality which kicks in automatically when the program gets a "NotSupportedException" on the common dialogs.

It's in 3.0.3, which I've re-published on PocketGear.

Friday, August 15, 2008

Jimmy SuDoku 3.0 Released

Those of you who have worked with me on a project in the past few years probably know of my hobby project. It's an implementation of SuDoku. It's made for Windows Mobile devices (cell phones, etc.), but it also runs on Windows XP (et al).

The old version, 2.5, had been published on PocketGear. This last update was published in January, 2007, just before I started with Edgewater.

I've been hacking at it here & there since then, but the project suffered from lots of maladies... most significantly lack of time.

So after more than a year and a half, I'm happy to finally announce Jimmy SuDoku 3.0!

3.0 has a whole new game state model, based on CLR classes rather than an XML DOM. This means the puzzle generator's fast enough on hand-held devices that it doesn't need a web service to do the work for it. Another side-effect of this change is a smaller run-time memory footprint, though I'm not sure by exactly how much.

I also figured out how to leverage the hardware controls on WM6.0 & 6.1 devices so that non-touchscreen devices can play, too.

Monday, July 21, 2008

SSIS Bug / Workaround

I ran across a "feature" (bug) in SSIS today that I figured I'd record in case I ran across it again...

Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E14. An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E14 Description: "Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".". An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E14 Description: "The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.". An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E14 Description: "Reading from DTS buffer timed out.".

According to this MSDN forum thread, it's a bona-fide SSIS bug (I'm running SQL Server SP2 with the latest known patches as of this date.)

So the problem is in the SQL Server Destination. Changing it out for an OLEDB Destination seems to do the trick.

Tuesday, July 15, 2008

WALL•E and Enterprise Data Landfills

"Life is nothing but imperfection and the computer likes perfection, so we spent probably 90% of our time putting in all of the imperfections, whether it's in the design of something or just the unconscious stuff. "
-Andrew Stanton, director of Disney/Pixar's WALL-E, in an interview on the topic of graphic detailing.

I'm enough of a sci-fi geek that I had to take my kids to see WALL*E the day it opened. I found it so entertaining that, while on vacation, I started browsing around the internet... digging for addititonal tidbits about the backstory.

I came across the quote, above, initially on Wikipedia's Wall-E page.

The simple truth carries across all applications of contemporary computer technology. Technology tools are designed for the "general" cases, and yet, more and more often, we're running into the imperfect, inconsistent, outlying, and exceptional cases.

To follow the thought along, perhaps 90% of what we do as software developers is about trying to get a grip on the complexities of... everything we get to touch on. I guess the remaining 10% would be akin to the root classes... the "Object" class, and the first few subordinates, for example.

Andrew Stanton's quote reminds me of the 90-10 rule of software engineering... 90% of the code is implemented in 10% of the time. (conversely, the remaining 10% of the code is implemented in the remaining 90% of time). I tend to think of this one as a myth, but it's fun thought.

It's dealing with the rough fringes of our data that's among the industry's current challenges, but it's not just corporate data landfills.

I recently heard a report that suggested that technology will get to the point that commercially available vehicles with an auto-pilot will be available within the next 20 or so years. What's really the difference, to a computer, between financial data, and, say, navigational sensor data?

So to flip that idea on its head, again, and you could have more intelligent artificial agents spelunking through data warehouses... WALL-DW ? (Data Warehouse edition)

Then again, I wonder if the 80-20% rule isn't what gets us into our binds to begin with.

Monday, July 14, 2008

Real Software Heroes

While scanning the channels looking for an interesting show to watch, I came across a show on the Science channel... "Moon Machines". I couldn't have been luckier than to see the chapter "Navigation".    (Update: Full video online here:  http://www.dailymotion.com/video/xxxiij )

I'd heard bits about the technology that went into the Apollo missions, and how there were some of the first "modern" IC-based computers on board, but I never really thought about the implications of what they were doing. Having these computers aboard meant they had software. There wasn't exactly COTS systems for navigating to the moon.

The episode focused quite a bit on the experience of the software development team, including some at the personal level. There were quotes like "Honey, I'm going to be in charge of developing something called 'software'."... (and the response: "Please don't tell the neighbors.")

I've felt pressure on projects before... stuff I was working on that represented millions of dollars in its success, and presumably millions lost in its failure. I've even worked on software projects where runtime production logic errors could send people to jail. I've never written software that human life directly depended on.

My hat is off to the folks who took up this monumental challenge for the first time in software history, and made it work. To me, that's every championship sports victory... ever... combined.

All I can say is... wow.

They knew what a monumental victory it was, too... 40+/- years later, and the engineers they interviewed were still moved by the awe of their own accomplishment, and the personal sacrifices they made to pull it off.

As well they should be. Fantastic!!

Thursday, June 26, 2008

SSIS: Unit Testing

I've spent the past couple days putting together unit tests for SSIS packages. It's not as easy to do as it is to write unit & integration tests for, say, typical C# projects.

SSIS Data flows can be really complex. Worse, you really can't execute portions of a single data flow separately and get meaninful results.

Further, one of the key features of SSIS is the fact that the built-in data flow toolbox items can be equated to framework functionality. There's not so much value in unit testing the framework.

Excuses come easy, but really, unit testing in SSIS is not impossible...

So meaningful unit testing of SSIS packages really comes down to testing of Executables in a control flow, and particularly executables with a high degree of programability. The two most significant control flow executable types are Script Task executables and Data Flow executables.

Ultimately, the solution to SSIS unit testing becomes package execution automation.

There are a certain number of things you have to do before you can start writing C# to test your scripts and data flows, though. I'll go through my experience with it, so far.

In order to automate SSIS package execution for unit testing, you must have Visual Studio 2005 (or greater) with the language of your choice installed (I chose C#).

Interestingly, while you can develop and debug SSIS in the Business Intelligence Development System (BIDS, a subset of Visual Studio), you cannot execute SSIS packages from C# without SQL Server 2005 Developer or Enterprise edition installed ("go Microsoft!").

Another important caveat... you CAN have your unit test project in the same solution as your SSIS project. Due to over-excessive design time validation of SSIS packages, you can't effectively execute the SSIS packages from your unit test code if you have the SSIS project loaded at the same time. I've found that the only way I can safely run my unit tests is to "Unload Project" on the SSIS project before attempting to execute the unit test host app. Even then, Visual Studio occassionally holds locks on files that force me to close and re-open Visual Studio in order to release them.

Anyway, I chose to use a console application as the host app. There's some info out there on the 'net about how to configure a .config file borrowing from dtexec.exe.config, the SSIS command line utility, but I didn't see anything special in there that I had to include.

The only reference you need to add to your project is a ref to Microsoft.SqlServer.ManagedDTS. The core namespace you'll need is

using Microsoft.SqlServer.Dts.Runtime;

In my first case, most of my unit testing is variations on a single input file. The package validates the input and produces three outputs: a table that contains source records which have passed validation, a flat output file that contains source records that failed validation, and a target table that contains transformed results.

What I ended up doing was creating a very small framework that allowed me to declare a test and some metadata about it. The metadata associates a group of resources that include a test input, and the three baseline outputs by a common URN. Once I have my input and baselines established, I can circumvent downloading the "real" source file, inject my test source into the process, and compare the results with my baselines.

Here's an example Unit test of a Validation executable within my SSIS package:

[TestInfo(Name = "Unit: Validate Source, duplicated line in source", TestURN = "Dupes")]
public void ValidationUnitDupeLineTest()
using (Package thePackage = _dtsApp.LoadPackage(packageFilePath, this))
thePackage.DelayValidation = true;
InjectBaselineSource(GetBaselineResource("Stage_1_Source_" + TestURN), thePackage.Variables["SourceFilePath"]);
thePackage.Execute(null, null, this, null, null);
string errorFilePath = thePackage.Variables["ErrorLogFilePath"].Value as string;
//throw new AbortTestingException();
AssertPackageExecutionResult(thePackage, DTSExecResult.Failure);
AssertBaselineFile(GetBaselineResourceString("Baseline_Stage1_" + TestURN), errorFilePath);

Here's the code that does some of the SSIS Package manipulation referenced above:

#region Utilities
protected virtual void DisableAllExecutables(Package thePackage)
Sequence aContainer = thePackage.Executables["Adjustments, Stage 1"] as Sequence;
(aContainer.Executables["Download Source From SharePoint"] as TaskHost).Disable = true;
(aContainer.Executables["Prep Target Tables"] as TaskHost).Disable = true;
(aContainer.Executables["Validate Source Data"] as TaskHost).Disable = true;
(aContainer.Executables["Process Source Data"] as TaskHost).Disable = true;
(aContainer.Executables["Source Validation Failure Sequence"] as Sequence).Disable = true;
(aContainer.Executables["Execute Report Subscription"] as TaskHost).Disable = true;
(thePackage.Executables["Package Success Sequence"] as Sequence).Disable = true;
(thePackage.Executables["Package Failure Sequence"] as Sequence).Disable = true;

protected virtual void DisableDownloadExecutable(Package thePackage)
Sequence aContainer = thePackage.Executables["Adjustments, Stage 1"] as Sequence;
TaskHost dLScriptTask = aContainer.Executables["Download Source From SharePoint"] as TaskHost;
dLScriptTask.Disable = true;

protected virtual void EnableValidationExecutable(Package thePackage)
Sequence aContainer = thePackage.Executables["Adjustments, Stage 1"] as Sequence;
TaskHost validationFlow = aContainer.Executables["Validate Source Data"] as TaskHost;
validationFlow.Disable = false;

protected virtual void EnableValidationExecutable(Package thePackage)
Sequence aContainer = thePackage.Executables["Adjustments, Stage 1"] as Sequence;
TaskHost validationFlow = aContainer.Executables["Validate Source Data"] as TaskHost;
validationFlow.Disable = false;

Another really handy thing to be aware of...


I highly recommend you implement this interface and pass it into your packages. Of course, in each event handler in the interface, implement code to send reasonable information to an output stream. Notice the call to thePackage.Execute, way up in the first code snippet... the class that contains that method implements that interface, so I can manipulate (when necessary) how to handle certain events.

Interestingly, I haven't needed to do anything fancy with that so far, but I can imagine that functionality being very important in future unit tests that I write.

Here's a visual on all the resources... the image shows SSMS over VS, with both database tables and project resources with common URNs to relate them.

I won't get into the details of the framework functionality, but I found it useful to be able to do things like set a flag to rebuild baseline resources from current outputs, and such.

I modeled some of my framework (very loosely) functionality on the Visual Studio Team System Edition for Testers, which we used on the TWM ISIS project.

Another interesting lesson learned: I can see that the folks who built SSIS were not avid unit testers themselves. SSIS Executables have a "Validate()" method. I encountered lots of problems when I tried to use it. Hangs, intermittent errors, all that stuff that testing should have ironed out.

Wednesday, June 18, 2008

Null Schema

I've been contemplating the whole "unstructured" thing for a while now, and I've developed some new hypotheses about it. The discussion's been around the fact that Web 2.0 / Enterprise 2.0 generates a lot of "unstructured" data.

I'm not sure "unstructured" is really the most technically fitting word, though. It's the word that works if you're a technical person talking to a non-technical person.

I think the information we're seeing in these settings is typically better structured than what we've seen in the past. The structures are being defined by the provider, however, sometimes on an ad-hoc basis, and can change without notice.

If you're in the geek domain, I think "undefined" fits better. Maybe "unknowable structure". It's Null Schema.

I think we've all seen tons of this... it's a trend towards increasing structure with less defined schema. It seems to fit with the "agile" trend.

So the other aspect of this Web 2.0 thing is that the data doesn't have to just be of an unknowable format. It can also be communicated through a number of communications channels, at the provider's discretion. People define conventions to ease this. Interestingly, the convened-upon channels end up providing context for the content. In turn, it adds to its structure... more null schema.

It flies in the face of our tightly defined, versioned SOA end-point contracts. XSOA? :)

It's been said that SOA lives in a different problem space, but that may only be a matter of convention, moving forward.

Friday, June 6, 2008

My Windows Mobile PCS Phone

I just gotta say... this thing's fantastic.

It's my own personal mobile phone (not company issued), but I really do get some hefty mileage out of it.

It's a Sprint Mogul 6800. Verizon has a similar unit (vx6800, I think). It's one of many Windows Mobile 6 devices out there... touch screen, with a stylus and a slide out keyboard. It was already a little dated when I bought it, but that just meant the price wasn't so high.

I'm just psyched because I bought this one back in September 2007, and I keep finding new uses for it.

My new assignment is in Boston. One of the rough edges of the assignment, for me, is the long commute... (1 hour minimum (if traffic's really good)). So after doing the math, I discovered that I can pick up the Boston Express bus ride from a neighboring town.

I'm on the return trip at this moment, using my phone for internet access, and it's really solid, EV-DO.A service. Connectivity is a USB port away.

While I'm doing that, I'm ALSO listening to 2Gb worth of music that I downloaded via subscription service from Napster using Windows Media Player Mobile.

The built in GPS was not software-enabled when I bought the phone, but a software upgrade released in January solved that. The GPS works great with the Google Maps for Pocket PC app I downloaded for free. This morning, it got me from South Station to NHP just like it got me from NYC's Port Authority bus terminal to the AT&T store on Madison Ave a few weeks ago to see MS Surface.

So I also toy with the .NET Compact Framework, and used it some time ago to write my own Windows Mobile implementation of sudoku. (I've been seriously considering refactoring to mess with LINQ in the .NET CF 3.5)

The built in camera's nice... I use it all the time when I've forgotten my "real" camera.

Wi-Fi is occasionally very handy... it's great when I need network access while talking on the phone.

So is bluetooth... I appreciate being able to talk on the bluetooth headset while taking notes or looking stuff up online... or just appreciate talking hands-free.

I sync the thing with Outlook, and rely on it too heavily for meeting reminders. That comes in handy at NHP, too, where network access is... limited. (I can even get RSS updates from the Tech Mill.) It's also integrated with Active Directory, so when I need a teammate's contact info, I can find it online as long as I have connectivity (pretty much always).

I've used the voice recorder a few times. It's been handy when I've needed it.

There's a whole list of "separate" items I don't carry because I have this thing... I don't wear a watch. I don't have an iPod. I don't carry a GPS handheld, or keep one in my car. I don't often carry around my camera. I seldom use paper to take notes, so I don't often need a pen. This one thing covers all that stuff, and more.

Did I mention that it's a phone? :)

Tuesday, May 20, 2008

Enterprise Reprogramming

I found an interview of a Satyam Senior VP listed on LinkedIn relatively interesting (link below).

This senior VP talks about how Satyam and the IT industry is responding to new challenges.

One thing that stands out to me is the statement that they are moving from services to solutions. They make the implication that they are rebuilding or reprogramming businesses at the workflow / process level. They appear to be successfully applying technology build-out as a commodity service while implementing their solutions... Sounds like they're treating the enterprise as a sort of programmable platform, like SOA / BPM on a grand scale.

From the article:
"A solutions provider transforms business. The difference in business will happen when we change those business processes as well. That is where we are bringing in business transformation solutions — process optimisation, process reengineering, etc. "

My intuition doesn't quite square with Satyam's vision.

Lots of things have been pointing towards more innovation in the top layers of applications, built on a very stable technology base. To me, it still feels like there's an unspoken motivation for that: business leadership wants IT folks to make ruggedized app dev tools and hand them over to power users (and/or process owners). Business leaders want IT to get the C# off their business processes.

All of that is sorta where I started cooking up the hypothesis of metaware from.

I'm curious to know how Satyam's vision is really working. I guess we'll know in a few years.

‘Moving towards IP-led revenues’

Sunday, May 18, 2008

Functional Expression

So one more thing crossed my mind about implementing code with respect to art & science, and I had to express it...

I looked up the term "Art" in the dictionary. The first definition is:
  • the quality, production, expression, or realm, according to aesthetic principles, of what is beautiful, appealing, or of more than ordinary significance.

For me, regarding coding, it's a matter of remembering a few points:

  1. implementation is expression
  2. significance is subjective
  3. beauty is in the eye of the beholder

So code can be expressed, fundamentally, in a bunch of ways:

  • Electronically,
  • Numerically,
  • mnemonically,
  • symbolically,
  • graphically,
  • gesturally,
  • audibly,
  • visually,
  • etc... ?

Simple, clever, elegant, seemingly natural expressions of all kinds are typically beautiful to a programmer, when they function correctly.

Of course, to me, the most beautiful implementations are implementations that elegantly express its business in a way that's very clear to anyone familiar with the problem domain at that abstraction level, and to the target platform(s).

See also:
politechnosis: Art & Science

Saturday, May 17, 2008

Artless Programming

So maybe I am strange... I actually have printed snips of source code and UML diagrams and hung them on my office wall because I found them inspirational.

Reminds me of a quote from The Matrix movies...
Cypher [to Neo]: "I don't even see the code. All I see is blonde, brunette, red-head." :)

It's not quite like that, but you get the point. There's gotta be a back-story behind the witty writing. I suspect it has something to do with a programmer appreciating particularly elegant solutions.

One of the hard parts about knowing that programming is an artful craft is being forced to write artless code. It happens all the time. Risks get in the way... a risk of going over budget, blowing the schedule, adding complexity, breaking something else.

It all builds up. The reality is, as much as we software implementers really want application development to be an art, our business sponsors really want it to be a defined process.

The good news for programmers is that every application is a custom application.

It really sucks when you're surgically injecting a single new business rule into an existing, ancient system.

This is the case with one of my current clients. At every corner, there's a constraint limiting me. One false move, and whole subsystems could fail... I have such limited visibility into those subsystems, I won't know until after I deploy to their QA systems and let them discover it. If I ask for more visibility, we risk scope creep. The risks pile up, force my hand, and I end up pushed into a very tightly confined implementation. The end result is awkward, at best. It's arguably even more unmaintainable.

These are the types of projects that remind me to appreciate those snips of inspirational code.

Don't get me wrong. I'm happy there's a fitting solution within scope at all. I'm very happy that the client's happy... the project's under budget and ahead of schedule.

The "fun" in this case, has been facing the Class 5 rapids, and finding that one navigable path to a solution.

See also:
politechnosis: Art & Science

Saturday, May 10, 2008

Art & Science

Fire & Ice... Day & Night...

This question, Art vs. Science, has come up a million times in software development circles. Reading Paul Johnson's (Paul's Pontifications) blog post, in conjunction with a discussion in the Tech Mill at Edgewater, (thanks, Jason!) I have come to see that art and science are not as opposite as I once viewed them to be.

What hit me was that Paul makes the statement that there's no process to implementing software. I still disagree. There are many processes.

The number of processes that an implementer can choose from to write his/her code is often vast, and depends on the problem set. A problem set includes many things, including requirements, tools, target platform, development platform, existing code, and even the implementer's mood and frame of mind. That is what makes implementing code, like painting, or creating a recipe, an art.

Within a common implementation problem set, there can be a large number of processes which can be applied to derive valid solutions. In fact, there are so many, that some distinct processes may actually render the very same code. So, to be more clear, it's not that there's no process... it's that there's no single valid process.

Knowing that there's no one single valid process doesn't mean that we can't pick a needle from the haystack... if the process produces a solution within the problem set, it's good.

Now consider what happens when you start to narrow a problem set. There's lots of things you can do. Frameworks, platforms, clear-specific requirements, best practices, coding standards, well structured architectures... these things are all factors that limit the problem set. By narrowing a problem set, you narrow the number of valid processes. By narrowing the number of valid processes that a developer can choose from, lots of interesting things start to happen. You achieve more predictable results, and are more likely to achieve repeatable schedules... and you reduce overall project risk.

This is what's so interesting about contemporary trends in software development, such as Ruby on Rails... use of these tools narrows problem sets that developers face. This means the implementer can spend less time figuring out where the blanks are, and more time filling them.

Now let's take this further. What happens when you reduce the problem set dramatically...? Take a single, relatively well known problem, on a very specific platform, using a very small set of unambiguous expressions. You get a very tightly defined process. By doing this, you wring the art out of creating something, to the point where it becomes machinable. The process becomes realized as a factory.

So to answer the question... Art or Science?

It's a trick question... art and science are not exclusive opposites. Art is about freedom to choose your creative process. Science is about knowing what processes are available, and the pros and cons of each. So programming, like all creative activities, is usually art (except in single-processed cases), and usually science (except in cases of serendipity and true miracles).

Paul's Pontifications: An Under-Appreciated Fact: We Don't Know How We Program

Thursday, May 8, 2008

Hands on Surface

There's a developing UI paradigm growing, and some of it has been released in the wild.

Multi-point touch screen systems are starting to take shape out of the ether, and it really feels like it's going to usher in a new era of computing. We've talked about a few of them here in the Tech Mill. It's "Minority Report" without the goofy VR glove.

Microsoft's offering in this arena is Surface (formerly "Milan").( http://www.microsoft.com/surface )

From available marketing materials, Surface is much like the other offerings that are under development, with a few interesting differences. Rather than being an interactive "wall", it's a "table". In addition to interacting to a broad range of touch-based gestures, Surface also interacts with objects. Some of it's marketed use-cases involve direct interaction with smartphone, media, and storage devices.

This week, I'm on a training assignment in New Jersey, but within a bus ride to one of very few instances of Surface "in the wild".

I made it a secondary objective to hit one of the AT&T stores in mid-town Manhattan.

I had a lot of high expectations for it, so actually getting to play a bit with it struck me as a touch anti-climactic. The UI was great, but it was clear they cut costs on hardware a bit: responsiveness wasn't quite as smooth as the web demos. It did impress me with the physics modeling of the touch gestures... dragging "cards" around the table with one finger mimicked the behavior of a physical card, pivoting around the un-centered touch point as a real one would.

I was also a bit concerned that the security devices attached to the cell phones they had around the table were some sort of transponder to hide "vapor-ware" special effects. My own phone (an HTC Mogul by Sprint) was ignored when I placed it on the table.

All in all, I was happy to finally get to play with it. Between technology advances and price drops, this UI paradigm will start to make it into the power business user's desk.

I mean, can you imagine, for example, cube analysis.... data mining... report drilling... and then with a few gestures, you transform the results into charts and graphs... then throw those into a folder on your mobile storage / pda device...

I'm still loving the idea of interactivity between physical and virtual (and/or remote) logical constructs...

Imagine bringing up the file server and your laptop on a "Surface" UI, and litterally loading it with data and installing software with the wave of your hand....


Having a portable "PDA" device with "big" storage... in fact, big enough to contain a virtual PC image... In stand-alone mode, the PDA runs the VPC in a "smart display" UI. When you set it on a Surface, the whole VPC sinks into it. You get access to all the Surface functional resources including horsepower, connectivity, additional storage, and the multi-touch UI while the PDA is in contact. When you're done, the VPC transfers back to the PDA, and you can take it to the next Surface UI in your room at the hotel, or the board room (which has one giant "Surface" as the board room table.)

The preview is over at AT&T today. According to Wikipedia, Microsoft expects they can get these down to consumer price ranges by 2010 (two years!).

Sunday, May 4, 2008

Multiprocessing: How 'bout that Free Lunch?

I remember reading an article, a few years back...

The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software

Its tagline: "The biggest sea change in software development since the OO revolution is knocking at the door, and its name is Concurrency."

Mr. Sutter's article suggests that because CPUs are now forced to improve performance through multi-core architectures, applications will need to typically employ multi-threading to gain performance improvements on newer hardware. He made a great argument. I remember getting excited enough to bring up the idea to my team at the time.

There are a number of reasons why the tag line and most of its supporting arguments appeared to fail, and in retrospect, could have been predicted.

So in today's age of multi-core processing, where application performance gains necessarily come from improved hardware throughput, why does it still feel like we're getting a free lunch?

To some extent, Herb was right. I mean, really, a lot of applications, by themselves, are not getting as much out of their host hardware as they could.

Before and since this article, I've written multi-threaded application code for several purposes. Each time, the threading was in UI code. The most common reason for it: to monitor extra-process activities without blocking the UI message pump. Yes, that's right... In my experience, the most common reason for multi-threading is, essentially, to allow the UI message pump to keep pumping while waiting for… something else.

But many applications really have experienced significant performance improvements in multi-processor / multi-core systems, and no additional application code was written, changed, or even re-compiled to make that happen.


  • Reduced inter-process contention for processor time
  • Client-server architectures (even when co-hosted, due to the above)
  • Multi-threaded software frameworks
  • Improved supporting hardware frameworks
Today's computers are typically doing more, all the time. The OS itself has a lot of overhead, especially Windows-based systems. New Vista systems rely heavily on multi-processing to get performance for the glitzy new GUI features.

The key is multi-processing, though, rather than multi-threading. Given that CPU time is a resource that must be shared, having more CPUs means less scheduling collision, less single-CPU context switching.

Many architectures are already inherent multi-processors. A client-server or n-tier system is generally already running on a minimum of two separate processes. In a typical web architecture, with an enterprise-grade DBMS, not only do you have built-in “free” multi-processing, but you also have at least some built-in, “free” multi-threading.

Something else that developers don’t seem to have noticed much is that some frameworks are inherently multi-threaded. For example the Microsoft Windows Presentation Foundation, a general GUI framework, does a lot of its rendering on separate threads. By simply building a GUI in WPF, your client application can start to take advantage of the additional CPUs, and the program author might not even be aware of it. Learning a framework like WPF isn’t exactly free, but typically, you’re not using that framework for the multi-threading features. Multi-threading, in that case, is a nice “cheap” benefit.

When it comes down to it, though, the biggest bottlenecks in hardware are not the processor, anyway. The front-side bus is the front-line to the CPU, and it typically can’t keep a single CPU’s working set fresh. Give it a team of CPUs to feed, and things get pretty hopeless pretty quick. (HyperTransport and QuickPath will change this, but only to the extent of pushing the bottle necks a little further away from the processors.)

So to re-cap, to date, the reason we haven’t seen a sea change in application software development is because we’re already leveraging multiple processors in many ways other than multi-threading. Further, multi-threading options have been largely abstracted away from application developers via mechanisms like application hosting, database management, and frameworks.

With things like HyperTransport (AMD’s baby) and QuickPath (Intel’s), will application developers really have to start worrying about intra-process concurrency?

I throw this one back to the Great Commandment… risk management. The best way to manage the risk of intra-process concurrency (threading) is to simply avoid it as much as possible. Continuing to use the above mentioned techniques, we let the 800-lb gorillas do the heavy lifting. We avoid struggling with race conditions and deadlocks.

When concurrent processing must be done, interestingly, the best way to branch off a thread is to treat it as if it were a separate process. Even the .NET Framework 2.0 has some nice threading mechanisms that make this easy. If there are low communications needs, consider actually forking a new process, rather than multi-threading.

In conclusion, the lunch may not always be free, but a good engineer should look for it, anyway. Concurrency is, and will always be an issue, but multi-core processors were not the event that sparked that evolution.

Thursday, April 10, 2008

Converging Metadata on XAML

In a recent project, we used Excel spreadsheets to capture the data dictionaries for our functional requirements. The project actually had 22 data dictionary sections, each with about a hundred data points described in them. Each data point had on the order of twenty properties that the client needed to know about. It included not only how to present the data entry field, but how to bind it at runtime to business objects, how to transform the user input before presenting the data to various back-end systems, validation, and a few other rules.

Excel spreadsheets can be saved off as XML, a fact which we leveraged. Our analysts filled in the Excel spreadsheets, identifying all the data points and the typical properties of each. After that, we engineers filled in bindings and a few other more technical details. Later, we transformed our Excel-document data dictionaries into a custom XML format (a Domain Specific Language or DSL) using XSLT. Finally, we compiled those extracts into our client application as a resource (one for each dictionary) containing all the client metadata for that dictionary.

Divorcing ourselves from the broken notion that XAML is WPF, and with just a little more time (on the order of days), we could have codified our DSL into a set of .NET classes. By doing this, we could have converged our data dictionary metadata on XAML. In effect, this would have turned metadata directly into runtime business objects. These business objects would have served as the content for our WPF-based LOB data entry forms. In turn, this would have greatly simplified a number of complexities, especially around the problem of indirect data binding. The end result would have been a more maintainable code base, and even faster running code.

Sunday, April 6, 2008


There's been a fair amount of buzz in the IT world about IT-Business alignment lately. The complaints seem to be that IT seems to produce solutions that are simply too expensive. Solutions seem to range from "Agile" methodologies to dissolving the contemporary IT group into the rest of the enterprise.

I think there's another piece that the industry is failing to fully explore.

I think what I've observed is that the most expensive part of application development is actually the communications overhead. It seems to me that the number one reason for bad apps, delays, and outright project failures, is firmly grounded in communications issues. Getting it "right" is always expensive. (Getting it wrong is dramatically worse.) In the current IT industry, getting it right typically means teaching analysts, technical writers, developers, QA, and help desk significant aspects of the problem domain, along with all the underlying technologies they need to know.

In the early days of "application development", software based applications were most often developed by savvy business users with tools like Lotus 1-2-3. The really savvy types dug in on dBase. We all know why this didn't work, and the ultimate response was client-server technology. Unfortunately, the client-server application development methodologies also entrenched this broad knowledge sharing requirement.

So how do you smooth out this wrinkle? I believe Business Analytics, SOA/BPM, Semantic web, portals/portlets... they're providing hints.

There have been a few times in my career where I was asked to provide rather nebulous functionality to customers. Specificially, I can think of two early client-server projects where the users wanted to be able to query a database in uncertain terms of their problem domain. In both of these cases, I built application UI's that allowed the user to express query details in easy, domain-specific terms. User expressions were translated dynamically by software into SQL. All of the technical jargon was hidden away from the user. I was even able to allow users to save favorite queries, and share them with co-workers. They enabled the users to look at all their information in ways that no one, not even I, had considered before hand. The apps worked without giving up the advances of client-server technology, and without forcing the user into technical learning curves. These projects were both delivered on time and budget. As importantly, they were considered great successes.

In more recent times, certain trends that have caught my attention: the popularity of BI (especially cube analysis), and portal/portlets. Of all the other tools/technologies out there, these tools are actively demanded by business end-users. At the same time, classic software application development seems to be in relatively reduced demand.

Pulling it all together, it seems like the IT departments have tied business innovation into the rigors of client-server software application development. By doing this, all the communications overhead that goes with doing it right are implied.

It seems like we need a new abstraction on top of software... a layer that splits technology out of the problem domain, allowing business users to develop their own applications.

I've hijacked the word "metaware" as a way of thinking about the edge between business users as process actors (wetware) and software. Of course, it's derived from metadata application concepts. At first, it seems hard to grasp, but the more I use it, the more it seems to make sense to me.

Here is how I approach the term...
Application Space. This diagram shows the surface of IT to User domains across technology and business process space. This surface covers hardware, software, metaware, and wetware, including where these 'wares touch.
As I've mentioned in the past, I think of people's roles in business systems as "wetware". Wikipedia has an entry for wetware that describes its use in various domains. Wetware is great at problem solving.

Why don't we implement all solutions using wetware?

It's not fast, reliable, or consistent enough for modern business needs. Frankly, wetware doesn't scale well.

Hardware, of course, is easy to grasp... it's the physical machine. It tends to be responsible for physical storage and high-speed signal transmission, as well as providing the calculation iron, and general processing brains for the software. It's lightening fast, and extremely reliable. Hardware is perfect in the physical world... if you intend to produce physical products, you need hardware. Hardware applications extends all the way out to wetware, typically in the form of human interfaces. (The term HID tends to neglect output such as displays. I think that's an oversight... just because monitors don't connect to USB ports doesn't mean they're not human interface devices.)

Why do we not use hardware to implement all solutions?

Because hardware is very expensive to manipulate, and takes lots of specialized tools and engineering know how to implement relatively small details. Turnaround time on changes makes it impractical in risk-management aspects for general purpose / business application development.

Software in the contemporary sense is also easy to grasp. It is most often thought to provide a layer on top of a general purpose hardware platform to integrate hardware and create applications with semantics in a particular domain. Software is also used to smooth out differences between hardware components and even other software components. It even smooths over differences in wetware by making localization, configuration, and personalization easier. Software is the concept that enabled the modern computing era.

When is software the wrong choice for an application?

Application software becomes a problem when it doesn't respect separation of concerns between integration points. The most critical "integration point" abstraction that gets flubbed is between business process and the underlying technology. Typically, general purpose application development tools are still too technical for user domain developers, and so quite a bit of communications overhead is required even for small changes. This communications overhead is becomes expensive, and complicated by generally difficult deployment issues. While significant efforts have been made to reduce the communications overhead, these tend to attempt to eliminate artifacts that are necessary for the continued maintenance and development of the system.

Enter metaware. Metaware is similar in nature to software. It runs entirely on a software-supported client-server platform. Most software engineers would think of it as process owners' expressions interpreted dynamically by software. It's the culmination of SOA/BPM... for example BPMN (Notation) that is then rendered as a business application by an enterprise software system.

While some might dismiss the idea of metaware as buzz, it suggests important changes to the way IT departments might write software. Respecting the metaware layer will affect the way I design software in the future. Further, respecting metaware concepts suggests important changes in the relationship between IT and the rest of the enterprise.

Ultimately it cuts costs in application development by restoring separation of concerns... IT focuses on building and managing technology to enable business users to express their artifacts in a technologically safe framework. Business users can then get back to innovating without IT in their hair.