September 2005 - Posts

How IBM Conned Our IT Execs out of Millions

I just love stories like this.

Open Source Microsoft Max

I’ve been thinking recently (which is always trouble) and I think Microsoft should open source Microsoft Max.  Let the developers around the world see how to build a “real” application using the latest technologies from WinFx.  Since it’s being given away for free open sourcing it isn’t going to result in any lost revenue.  Most likely it will result in a lot of developers checking out the source which may help inspire them to use WinFx to create killer apps.  Getting more developers using WinFx is the end game isn’t it?  I vote for open sourcing Microsoft Max!

Brian D's bloggin it up

One of my former co-workers just started up a blog and as everyone will be able to see from the links he has on the left hand side of his blog he is one smart dude.  

 

An O/R Mapper feature request

I'm a big fan of O/R Mappers. By leveraging an O/R Mapper within an application we're able to greatly reduce the amount of custom data access logic necessary for building our applications.

In a previous life I spent a pretty good amount of time developing my own O/R Mapper. At the time I didn't know what I was building, I just knew I wanted to reduce the amount of repetative data access code within my applications. I used my custom mapper in a lot of applications over the last couple of years. Having built the mapper myself I was never put in a spot where the mapper didn't do what I needed it to. It certainly had things it didn't handle but those things weren't important for the applications I was building. And if something that I thought was unimportant all the sudden became important I could just modify the framework to account for it.

As I was working on ActiveType I started to think about switching from my own custom O/R Mapper to one of the more popular mappers such as Wilson OR Mapper or NHibernate. As you can probably tell by the lack of posts on ActiveType I haven't spent as much time on it as I had hoped over the last couple months. This will likely change shortly as I start to wrap up a couple other projects that have been taking my time away. Anyway get to the point already.

One of the things that I think is missing within the "popular mappers" is basic support for joins. In a lot of application I work on I have lookup tables that are referenced by other tables in the database. The lookup tables often contain an ID along with a textual description. Being the good normalized developers that we are we only store the ID of the lookup value in our tables rather then the textual descriptions. When displaying objects within the application users often want to have the textual description for the lookup displayed rather then just the ID that is stored within the table. In applications that aren't using an O/R Mapper this is usually pretty straight forward. We just write some simple SQL to join the lookup table with the primary table that we're displaying to the user. We then execute the SQL and return a data reader with all data and fill our custom objects. As soon as we introduce an O/R Mapper we lose this basic functionality. Since most mappers map to a single table it becomes more difficult to bring back all the textual lookups that we want.

A good number of mappers support mapping to views and stored procedures but when developing an application that supports 3+ databases the maintenance of stored procedures and views for each different type of database (Oracle, SQL Server, Sybase) can quickly become a bit of a maintenance nightmare.

What I'd like to see is very basic support added to some of the popular .NET O/R Mappers for supporting this basic scenario. Allow mappings to be setup to foreign key tables so that textual lookups can be returned when retrieving lists of objects. Don't go nuts and think of every possible scenario, just provide the basics. Let me say what table to join on and whether I want an inner or outer join. Require me to explicitly tell the mapper that I want this full load to occur and when I don't tell the mapper I want the full load revert back to the basic load that just uses the information in the table which my object is mapped to.

Thoughts?

Code Commenting

One of the great features available within C# is xml comments. They allow us to create inline documentation that can be converted into nice API documentation that we can deliver to those using the API's we're developing.

One of the things that I would love to see within VS.NET or within some sort of add-in is the ability to keep comments synchronized between interfaces and the classes that implement the interfaces. Within the application that I'm currently developing we're defining interfaces for a decent number of our objects. When it comes time to create the xml comments for the interfaces as well as the classes we end up copying and pasting comments from one file to another. What would be super sweet is if someone would create an add-in that would let me right click on a comment and say "update comments from interface". This would allow me to have nice API documentation for all my interfaces as well as my classes and also help me continue to be lazy which we all know is a strength in the programming world.

Anyone want to write it?

Wishing I was at the PDC

The hype has begun.  It sounds like this PDC is going to be jam packed with lost of exciting demos targetted at the developer community.  One of these years I’m going to convince the powers that be to send me.  Maybe next PDC….

The UI is important

As programmers we often dismiss the importance of a good UI.  If we make our services, components and objects as slick as we’ve planned we won’t even need a UI. Who needs an application that’s usable when we have this great API?

If you haven’t already started thinking about the usability of your applications…start now.  As programmers we often lose sight of how our users will interact with the application we’re creating.  We often think that the most features possible is the answer. 

Listen to guys like Jan Mikosvsky, learn to love a nice UI!

Model View Presenter

One of the things that I’ve always found difficult is the testing of Gui interfaces.  In the web world I started to form some thoughts and ideas on how to improve the testability of a UI.  Now that I’m in the windows world I’m going through the same process but rather then dealing with a web UI I’m dealing with a windows UI.  Model View Presenter is one of the patterns that I’m going to be experimenting with during my quest.

Development of Further Patterns of Enterprise Application Architecture

One of my favorite books is Patterns of Enterprise Application Architecture by Martin Fowler.  A couple months ago I came across the beginnings of a second volume.  To this point Martin has the following patterns:

Narratives: Temporal Patterns, Organizing Presentation Logic

Accounting Patterns: Account, Accounting Entry, Accounting Transaction

Domain Event Patterns: Agreement Dispatcher, Domain Event

Rich Client Patterns: Event Aggregator, Flow Synchronization, Mediated Synchronization, Model View Presenter, Notification, Presentation Chooser, Presentation Model, Window Driver

Temporal Patterns: Audit Log, Effectivity, Snapshot, Temporal Object, Temporal Property

Unclassified Patterns: Range, Time Point

If your interested in patterns keep an eye on Martin’s site for additional updates.  If your not interested in patterns…..well….what are you waiting for, get interested.

BackgroundRunner to help with BackgroundWorker

A month (or so) ago I wrote about the nice addition of the BackgroundWorker in .NET 2.0.  The BackgroundWorker class is a great asset for those of us writing distributed applications.  Rather then locking up our UI every time we make a expensive web service call we can run the process on a background thread and allow our users to continue working within the UI.

Over the past month I’ve found myself using the BackgroundWorker fairly often.  Being the good lazy programmer that I am this has led me to create a helper object which I’ve called the BackgroundRunner.  My BackgroundRunner is nothing more then a utility class for helping me reduce the amount of code required when running processes using a BackgroundWorker.

The BackgroundRunner has several static “Run” methods for running asynchronous operations.  The Run method accepts delegates as parameters and handles wiring up the delegates to the appropriate events on the BackgroundWorker class.

///

<summary>Run an asynchronous operation and process the results./// </summary>
/// <param name="doWork">The delegate that will perform the actual work.</param>
/// <param name="completedEvent">The delegate that will work with the result provided by the doWork operation.</param>
/// <param name="onError">An event handler to handle any errors that occur during the doWork operation.</param>
/// <param name="suppressErrors">A flag indicating if errors should be suppressed.</param>
private static void Run(DoWorkEventHandler doWork, RunWorkerCompletedEventHandler completedEvent,      
                                   
EventHandler<DataEventArgs<Exception>> onError, bool suppressErrors) {

BackgroundWorker worker = new BackgroundWorker();
numberOfRunningProcesses++;
worker.DoWork += delegate(object o, DoWorkEventArgs workEvents) {
              try {
                doWork(o, workEvents);
              }
              catch (Exception exception) {
                    if (onError != null) {
                      onError(o, new DataEventArgs<Exception>(exception));
                   }
                   else if(!suppressErrors) {  
                       throw;
                   }
              }
           };

if (completedEvent != null) {
    worker.RunWorkerCompleted += delegate(object o,  RunWorkerCompletedEventArgs workerCompleteEventArgs) {
      completedEvent(o, workerCompleteEventArgs);
      numberOfRunningProcesses--;
    };
}

worker.RunWorkerAsync();

}

Into the Run method I pass the DoWorkEventHandler which is actually going to do the work, the RunWorkerCompletedEventHandler which is going to handle the results of the “work”, an event handler for handling any errors / exceptions that occur, as well as a boolean which determines if errors that occur should be suppressed or not.  You can also see I’m incrementing and decrementing a numberOfRunningProcesses variable.  The numberOfRunningProcesses variable is a static that can be used to determine if we have any processes currently running in the background.  This can be helpful if you want to prevent users from exiting your application while a background process is still running.

Feel free to use this code at your own risk.  If you have comments or suggestions on how it can and should be improved please let me know.

UPDATE: removed verbosity from delegate assignment as recommended by Wesner Moise

Hosting Indigo in a Windows Service

Update: As many of you probably guessed when you read this entry it ended up being a stupid user error.  Yeah, me!

I’ve recently been experimenting with the netProfileTcpBinding in Indigo to see what kind of performance improvement it offers over the Http bindings.  I’ve been able to host Indigo services from a console host application, however, I have not had any luck getting the same services hosted in Windows Services.  I’m using the same hosting code within both applications as well as the exact same configuration.  When I call my Indigo service hosted in my Windows Service I get the following error:

“A Tcp error (10061: No connection could be made because the target machine actively refused it) occurred while connecting.”

When I call the same service hosted in a console app everything is peachy.  What are the differences between hosting Indigo services in a console host as opposed to a windows service host?

Why software sucks

Does your software suck?  Scott Berkun has an interesting essay entitled “Why software sucks (And what to do about it)” which might help you realize if your software sucks.  Don’t worry I’m sure it’s not your software, its the guy sitting next to you.

It’s a lot easier to write software that sucks then it is to create software that users can kick ass with.  I think I’ve probably written a lot of sucky software, I just hope I’m getting less sucky then I was.  Scott’s essay looks at a number of different things that might be leading to sucky software.  As software developers we need to get better, we need to not be as sucky.  We really do need to help our users kick ass.

How does this help the user kick ass?

Is there a better motto for software developers then “make it so the user can kick ass”

Create passionate users…help them kick ass!

Windows Workflow Foundation (WWF)

At PDC last week Microsoft announced Windows Workflow Foundation.  For me, it was the most exciting announcement of the week.  Workflow is one of the most basic elements within many of the applications that I develop.  Today most of the workflow logic within the application I’ve developed is defined within custom C# classes.  Although it fills the basic workflow needs of my applications it is far from ideal. 

By providing workflow as part of WinFX Microsoft is providing us with a very powerful framework for creating workflows within our applications.  I’m working on several projects at the moment which are a perfect fit for WWF.  I’ll be looking forward to reading through Presenting Windows Workflow Foundation as well as learning all about how to build applications that leverage the wonders that WWF provides.  All this new technology is going to be a blast to learn!

Google has deleted me

Every once in a while I try a couple basic searches on google to see where my site ranks.  I usually start with a basic search on my name and then try a couple other searches to see how things have changed.  Today I was delighted to find that my site appears to have been wiped from Google.  If I do search on my name I don’t show up in the first couple pages.  I can find a couple indexed pages by searching for pages on my site but that doesn’t explain why I’ve disappeared when searching for my name.  I used to be right below my DNJ blog, but I am now gone.

Support Team Eichert at the 2005 Buddy Walk

I usually try to keep my personal life separate from what I post here and up until know I think I’ve done a pretty good job of that.  Tonight that changes, tonight I write about something very personal, and very close to my heart.

Let me start back where “this” all started for me.  About 2–21/2 years ago my wife and I found out that we had been blessed with our second child.  We were extremely excited.  A couple months into my wife’s pregnancy we made a visit to the Doctor’s to have an ultra-sound.  As anyone who is a father knows getting that first look at your little baby is something you never forget.  It’s one of the first times that you feel like you’re really going to be a daddy.  During our ultra-sound my wife and I started to get un-easy as the Dr. looked and re-looked, he seemed concerned about something.  Soon after he finished the ultra-sound he told us that he saw several indicators within the ultra-sounds that led him to believe that our little baby might have down syndrome.  After a couple more thorough tests it was confirmed.

Four or so months later my son Steven John Jr. was born.  Put simply, he is “the man”! 

In a couple weeks my wife, daughter, Steven John, and I will be attending our second Buddy Walk.  We have registered “Team Eichert” on the Trisomy 21 Center website and are encouraging peeps to make a small (or large if your so inclined) donation to help support my little man..

It’s funny how things happen in life.  You hear news that your son has down syndrome and you immediately feel sadness in your heart.  What you don’t realize at the moment is the amazing amount of joy and happiness that child will bring into your life.  It’s not always easy having a child with Down’s but it is always an amazing blessing.  I’m so very proud of my little Steven John Jr. 

To make a donation browse to: http://www.tri21center.org/Teams.asp?team=136&Go=Continue and click on the “Click here to Donate!” button.  Any and all donations are extremely appreciated!

Who should you target when building next generation software?

One of the things I’ve been thinking about recently is where our focus should be when building software.  Should we focus on months 0–3 after our initial release or should we be focusing on months 6–18? 

This is particularly important when you start thinking about what technologies you’re going to be using to build your software.  In the next year we’re going to get a lot of great technology for building software.  Indigo, Avalon, and Windows Workflow Foundation are all very powerful technologies that provide many advantages over some of the existing technologies we have available.  In fact they all provide something we don’t have.

We have several options available if we’re building software today.  We can adopt these new technologies and have some of our users be resistant to installing early versions of our software because of the “unproven” (and maybe beta status) of the technologies we’ve used to build our software.  Or we can use the current technology stack and create software that isn’t quite as feature rich or powerful but provides less for users to “fear” in the early days.

I believe that you should do what will be best for your users over the “long term”.  Some early releases may not get as much traction with users because of some of the “unproven” technologies being used, however, in the longer term using these newer technologies will provide many benefits.  Having software built on Indigo and Windows Workflow Foundation beats having software built on ASMX and some homegrown workflow solution. 

Build for the future.  Use the good stuff.

Creating Passionate Users

I couple days ago Brian pointed me to a blog that he came across about Creating Passionate Users.  When I saw that it was by the “guys” who write the Head First series of books I immediately added the feed to Omea so I could start digesting the “passionate user goodness” that would be flowing out of their feed.

Their recent post on “Listening to users considered harmful?” struck a cord with me.  As a big proponent of Agile software development I’m a firm believer that getting users to look at your software as early as possible in the development cycle is the best thing you can do.  No matter how many pictures you draw the user won’t really know what they’re getting, and if they’ll like it until the software is in their “hands”.  The earlier you can get the user playing with your software the better.

Another key concept within the agile software development practices is listening to your customers and incorporating what you hear from them into future iterations.  Customers should be driving what your doing, they should help you find the highest value features, and be at the front of your mind when you begin picking out stories for each iteration.

But what if listening to users isn’t what you really need to do?  What if these “Head First Guys” are right?  What if not listening is the key?  That changes everything doesn’t it? 

Intro to Building Indigo Services

Clemens Vasters has a new article on MSDN providing an “Introduction to Building Windows Communication Foundation Services”.  As you might have found, I prefer the the pronunciation that Chris Anderson alluded to when he said…...”and for clarification, yes, "WPF" is pronounced "Avalon"... the WPF is silent.”  I like to think that can be applied to WCF as well.  WCF is pronounced “Indigo”…the WCF is silent.

Paul thinks DLinq is a mess as well

Paul Wilson agrees that DLINQ is a big mess.  I’ve read a couple blog entries that have me hope that there might be a chance we get closer to what I want but I’ll be surprised if we actually get there.

Paul thinks DLinq is a mess as well

Paul Wilson agrees that DLINQ is a big mess.  I’ve read a couple blog entries that have me hope that there might be a chance we get closer to what I want but I’ll be surprised if we actually get there.

Handling Errors in Indigo

Jurgen Postelmans has posted a couple entries on handling errors in Indigo.  It’s definitely worth keeping an eye on his blog for additional entries on the wonderful world of Indigo.

It's a great time to be a developer

I’ve been trying to take in all the developer related news coming out of the PDC.  During my attempts to do so I couldn’t help but think about what a great time it is to be a developer.  The only frustrating thing is with the flurry of announcements it becomes hard to keep up with everything.  I think I do a pretty good job of getting most of the major stuff but I’m finding it harder and harder.  I imagine it’s only going to get worse.

Thoughts on DLINQ

Let me start by saying that I think LINQ is amazing.  I watched the channel 9 video with Anders and was very impressed. 

Now let’s talk about DLINQ.  I’m a big fan of attribute based programming.  I’ve long resisted giving into the xml mapping crowd that has been growing stronger and stronger in the O/R Mapping community.  I’ve conceded to them, having mappings defined in an external mapping file is a better approach.  Microsoft, you should concede to them as well.  Change DLINQ to use a mapping file rather then embedding everything within attributes. 

LINQ is amazing, make DLINQ equally as amazing.  Don’t make DLINQ just another mapper.  Make it something revolutionary.  Start thinking in more generic terms.  Don’t think of the mappings as Databases, Tables, and Columns.  Do think in terms of data stores, entities, and properties.  Make it so we can persist our objects to more then just a SQL Server database.  Give me persistence providers, allow me to persist to more then just SQL Server.

Don’t make DLINQ something that “newbie” developers use to create ad-hoc applications, make it something that software development shops can use within their software that supports 3+ databases.  Make it so we can persist things to Oracle, Sql Server, Sybase, Access, MySql, Postgress SQL.  Allow us to persist things not only to databases but also to Xml files, to WinFS data stores, and to whatever else data store we want.  Let me win the Newsgator API contest by creating a DLINQ provider for Newsgator

Don’t make just another mapper.  Don’t use attributes.  Don’t restrict me to just SQL Server.  Don’t limit your thinking to only one type of data store. 

Do make something revolutionary.  Do what you did with LINQ.  Make something revolutionary.  Make something I can use.  Please?

 

Thoughts on DLINQ

Let me start by saying that I think LINQ is amazing.  I watched the channel 9 video with Anders and was very impressed.