Tuesday, May 12, 2009

Moving up

The Duke Health Technology Solutions has offered me a full time position and I have decided to accept! This is a marvelous step forward and I'm very excited to join the team. It does mean that I'll have to pass off my current project to another contractor as I'll be shifting my job responsibilities, but I'm confident that the codebase is well commented and clean enough that it should be relatively easy for another software engineer to pick up where I'm leaving off.

It's been a very interesting transition. The work environment here is much different than what I experienced at Microsoft. Here, the expectations and pressures seems to be much more reasonable whereas at Microsoft I would have been in dire straits if I did not work at least 50 hours a week. This could partly be my aptitude, but I think that everyone in the local office worked at least that much so I certainly wasn't alone. At Duke, while there will still be pressures of deadlines and delivery milestones there will be more opportunity to be flexible in the features to be delivered since we can much more easily push out patches and updates. At Microsoft, such augmentations had to happen via service packs or subsequent releases so could be significantly delayed.

I'm confident that this environment is much better suited to my work style, as well as my desired work/life balance. It feels so great to be joining this team, especially because I'm actually excited to come to work and face the challenges presented here!

Wednesday, April 29, 2009

WCF and Silverlight debugging

As part of my latest updates to my current project, I made a change to the underlying WCF service that provides much of the information to our Silverlight application. In one of my DataContract classes, I started passing a child class to one of its DataMembers (i.e. the DataMember is a property on Foo, I passed in a Bar which is a subclass of Foo). Then, when Silverlight called the asynchronous version of that method, I started getting an ambiguous error: "The remote server returned an error: NotFound"

I stepped through both the Silverlight side and my WCF side - no errors apparent either place. However, just after the return statement in WCF and method exit, the Silverlight's service reference would pop up the "NotFound" error. Strange, I thought... what's the problem?

Other web searched seemed to direct me to update the buffer size, to delete and re-add the service reference, all to no avail. Finally, I changed the type on my datacontract's datamember to be the subclass instead of the parent class. Voila! Like magic, everyone's happy again. I'm not certain of the mechanics behind this failure- it seems like it should be allowable. In any case, if you hit this error, check the types on your data members as well - see if there's a more specific class you could be using instead.

Wednesday, April 22, 2009

Warning signs

Writing effect warning signs lesson #1: If the major reason to heed the warning doesn't get them to pay attention, give them a minor reason, too.

Not only will this kill you, it will hurt you the whole time you are dying

Tuesday, April 21, 2009

Unit testing with Silverlight

I'm in favor of test driven development. The sooner you find bugs in the product cycle the less costly the are to fix, afterall. Currently, I'm working with Visual Studio 2008 SP1 with the Silverlight tools installed - my current project is a multi-tier system with DB backend, WCF web services, and a Silverlight client.

However, when I added a test project and attempted to navigate to the Code Coverage tab of my test run config, the run config editor simply closed. I tried a few of the usual suspects - devenv /resetsettings, devenv /resetuserdata, repairing my Silverlight VS add-in installation - all to no avail.

Then, after one MSDN search, I discovered that this is a known issue. The fix is available here and it's working for me so far. Hooray for test enablement!

Friday, February 20, 2009

IDisposable, or how to write bad sample code

I've started my new job and am working on some data access code to IBM's DB2. I came across the following two incongruous pages in the IBM Data Server Provider for .NET reference.

First, there's the DB2Connection class. In the remarks, it specifically states:

The DB2Connection object uses native resources. You should always explicitly close any open DB2Connection objects by calling Close or Dispose before the DB2Connection object goes out of scope

However, on the DB2DataAdapter class reference page, they happily ignore their own advice. They also fail to mention that DB2DataAdapter is disposable and should be handled as such.

Here's my recommendation for new sample code:

public DataSet SelectDB2SrvRows(DataSet dataset,string connection,string query)
{
using (DB2Connection conn = new DB2Connection(connection))
{
using (DB2DataAdapter adapter = new DB2DataAdapter())
{
adapter.SelectCommand = new DB2Command(query, conn);
adapter.Fill(dataset);
}
}

return dataset;
}

Thursday, January 29, 2009

Episode 4: A new start

On February 9th, I will be starting my new position at Duke Hospital. I will be updating the software that provides the doctors a summary page view of a patient's vitals, recent lab results, and other crucial information with the option to "zoom in" on a given dataset or increase the timespace to twenty four hours, or three months, etc.

This is a crucial application that helps doctors and other healthcare professionals save lives and increase quality of life for their patients. I am proud that I will be part of this team of two contractors with one mentor from the regular IT staff.

At the same time, it's bittersweet leaving Microsoft in the middle of a product release cycle. There were so many more tasks to complete and improvements to make that now may be left incomplete as my team is down on pair of hands. I'm sure they'll get by, but I will miss them.

Changing jobs is never easy. I hope in this blog to track my path toward a gruntled and combobulated place in my work life, and maybe find a little inner zen along the way.

Also, did you ever notice that "combobulated" sounds like "I'm hanging out with a guy name Bob until the wee hours of the morning"?