# Monday, March 15, 2010

Say you have a .Net application.  From a deployment perspective, your application is a relatively normal application.  A primary executable, probably Windows Forms or WPF based, a class library or two, and a few third party controls.  The application has reached a shipping point and now it's time to distribute it to more than a few workstations.  You've chosen to distribute your application using the Windows Installer.  You're now faced with determining the strategy for maintaining the workstations that have installed your application.  Whatever strategy you choose to pursue, you will be confronted with this question:

When I update my application, do I replace all of my assemblies, making updating simple, or do I replace only what I just changed, making updates smaller, but more complicated?

This question is going to arise whether you create Windows Installer upgrades and patches, use a third party updating solution, or even consider rolling your own updater.  Regardless of the tool you use, at some point you will find yourself pondering the topic.  The physically small update is the apparent no-brainer.  The uninitiated may say, "of course we want our updates small.  Nobody wants to wait on updates, and we don't want to waste bandwidth.  Net neutrality isn't here yet!"   This is all true, and can be a compelling argument. So you march forward on the task... until the details emerge.  To keep updates small, versioning rears its ugly head.  An incremental update can only target specific previous versions.  For manually distributed software updates, as is often the case with Windows Installer deployments, knowing what version you have, and which patch, or patches, you need to apply becomes as big a deterrent to end-user updating as a larger update.

After considering the challenges of implementation, the simplicity of larger, but version agnostic updates will cause you to reconsider your seemingly obvious initial plan. This is a big reason why so many organizations start out attempting to distribute patches and incremental upgrades, but then revert to the far more common version agnostic approach of uninstall/re-install. (There are plenty of technical challenges involved in actually producing working Windows Installer upgrades and patches, which also plays a role here as well).

So which path do you choose?  Consider the following.

  • Frequency of updates
    If you are creating updates frequently, you want the update process creation to be as automated as possible. Decreasing the manual involvement increases efficiency as well as lowers the opportunity for mistakes. If you have the infrastructure to automate the creation of small, incremental updates then you should do so. If not, your update process will be simpler and less prone to error if you build larger, version agnostic updates. Even if you are doing this frequently.
  • Frequency of application use
    For applications that are launched and updated infrequently, accumulating incremental updates can create an undesirable user experience. Try to avoid forcing your users to regularly discover and apply multiple updates, one right after another. You should build larger updates that apply to more versions, or ensure your update process can apply multiple individual updates in a single update session.
  • Physical size of the application files
    Physically large application assemblies make for large updates. File patching can significantly reduce this size of an update, but requires strict control of which previous versions can apply the update.
  • Number of deployed clients
    For applications with many thousands of deployed clients, the network burden of larger updates is much more significant than applications with tens or hundreds of deployed clients. As your installed user base grows, minimizing the physical size of each update becomes far more important in order to manage your server bandwidth utilization without resorting to throttled update deployment.
  • Network Environment
    The network speed between the update server and deployed clients can dictate your decisions, especially when slow links are known to exist. When your application lives within slow networks, smaller updates are more desirable.
  • Background Download to Reduce the Burden
    Downloading updates in the background and informing the user when an update is ready to apply removes much of the burden the user experiences with larger updates.  It doesn't remove the burden from the network though.
  • Infrequent Exceptions to the Norm
    Targeting multiple versions, and making exceptions when you need to update infrequently modified files, such as third-party tools and help documentation keeps the initial update implementation effort low, ongoing update creation simple, and minimizes the burden that updating places on the end-user.

A commonly pursued solution to this updating dilemma is not to consider application updating as an in incremental progression, but rather a "synchronization" process.  A process where deployed workstation application files are kept in-sync with a master version located on a server.  This approach works well if the updating process only updates files. It doesn't work so well when application maintenance also requires performing other updating activities, such as registry and data store maintenance.  Security and licensing concerns also make the "sync" approach more challenging and less desirable than version migration approaches.

Our updating solution, AppLife Update, is an incremental updating solution.  Each update is self-contained, and includes all of the updating logic and new files/assemblies needed to migrate a deployed application from a previous version to a new version.  When an update is created, you get to choose which previous versions can successfully apply the new update.  You can target all previous versions, a list of discrete versions, or all greater than a previous version.  How you've defined the update obviously determines which previous versions you can target.  When defining an update, you have a lot of latitude in your decisions.  You can package and deploy Windows Installer databases, you can replace whole files, you can individually patch existing files, you can use update actions that automate the determination of which files need to be updated.  With an update system like AppLife Update, there is little difference in the effort needed to create updates that target all previous versions, or just the most recent version, however the bandwidth and user experience factors still need to be considered.

The flexibility is there to create the application updating strategy that best fits your application and your organization.  If the size of the update package necessary to replace all of the assemblies built in a standard upgrade of your application is acceptable, your update process will be far simpler to create and maintain if you target all previous versions with each update.  If the factors involved with your application dictate smaller updates, you can easily extend your updating process to seamlessly discover and download multiple updates, as well as display to the user a unified updating experience.

Tuesday, March 16, 2010
# Tuesday, March 02, 2010
 #
Posted by Brian Haas on Wednesday, March 03, 2010
 

The video below demonstrates how to update enable a .Net application in 60 seconds using AppLife Update.  And once enabled, maintaining deployed .Net applications is very easy.  In the video, you see an update created that replaces files and reads a registry key. The update then places the value from that registry key into the app.config file (an appSettings value). And for versatility, an MSI is installed and the registry key previously read in an earlier action is shown to the update user through a progress notification event initiated from C# code!

This update video demonstrates a few of the common activities that are needed to update and maintain deployed .Net software. It only scratches the surface of what can be done with AppLife Update.

If you are responsible for developing and maintaining a .Net application, you need to check out AppLife Update. Maintaining deployed release applications, as well as beta and QA installations have never been this easy.

http://www.kineticjump.com/update/

Wednesday, March 03, 2010
# Wednesday, February 24, 2010
 #
Posted by Brian Haas on Thursday, February 25, 2010
 

Auto-updating deployed software is easy right?  I mean come on, how hard can it be to download a file from the internet and replace the old with the new. Why wouldn't I roll my own? I'd knock this out in a day or two.  All I'd need to do is...

Replace some files

I'll need to download the new files and replace the old ones.  Well... since my application is running and the files I need to replace are locked I'll need to do something with that.  Let's see, I'll just shadow load the exe.  When the application starts, I'll just copy it to another location and run it from there.  That way when my updater wants to replace it with the new one, it'll work.  I might have problems when I want to add another assembly to my application. rollyourown I guess I'll have to copy all the assemblies when my app starts.  That could get messy, but it's quick and easy.  Moving on...

I'll need to know when an update is available.  OK, I can just retrieve a little file that will tell me what the current update is.  If the current update is newer than what is on the client, I'll download it and replace the client file with the updated file.  What?  Hmmm.... your right.  This will have to be changed if I ever want to update just part of the install, but I'll sort that out later when I have more time and I actually need to do it.  On to downloading...

Downloading an update

Downloading should be easy. The .Net framework gives me the WebClient class, which will make it as easy as pie.  I'll probably want to give my users some feedback and let them cancel.  My updates won't be very big so I don't think I'll need to worry about resuming from a previously failed update.  Everyone has fast internet connections now anyways. What's that?  Proxy servers could be a problem?  Well that'll take some time to sort out, so I'll just auto-detect, and if that fails then those users will just have to download the installer again and update the old fashioned way.  You think I should worry about getting hacked?  Not likely.  After all, we're pretty small and don't have that many users.  If they did though, I better do something to prevent that. That'll take some time to sort out, so I'll worry about it when we get big. Maybe crypto-signing or something... later.  Let's move on to actually updating the client...

Updating the client system

This will be super easy.  I'll just launch a little exe that will download the new files and replace the old ones.  What? Permissions might be a problem?  Never mind all that.  My users are all administrators on their machines anyway. What? Vista and Windows 7 doesn't even let administrators replace files everywhere?  Well then my users will just have to install the application somewhere where they do have permissions to replace files, or get someone who does have permissions to update their software.  We'll make a better solution later when we have more time to sort it out...  We can always update the updater later.  What?  I know the updater is running!  I'll just have to shadow launch the updater too so that I can replace it during an update.

And when the updater fails

All I am doing is replacing a file or two.  Why would the updater fail?  The user can just tell me which files are replaced and which ones aren't.  Later... when we have more time we can back up the files before we try to replace them or maybe even totally change the way we update the files.  Someday maybe we'll even add some logging so that we can figure out what happened when things go wrong.

Publishing updates

We'll just copy the new files to our web server whenever we build a new version so that the updater can download them. That's easy enough.  Yeah your right. Maybe we should compress them or something.

You know... this sounds like a lot more work than I thought.  It might take me weeks, not days to get this done.  I wonder if there is something I can buy that will do all this?  That would save me a lot of time.

Thursday, February 25, 2010
# Monday, January 25, 2010
 #
Posted by Brian Haas on Tuesday, January 26, 2010
 

When discussing software requirements documentation, a very common question asked is "When is a software specification complete?"  This is a very subjective question, and answers are often as far apart as discussions comparing waterfall to agile software development methodologies.  I like to break the discussion into two parts.

  1. When is requirements elicitation complete?
  2. When is requirements elaboration complete?

If you split the question and look at the issue in this way, you can at least get to a non-subjective half answer.  I know... what a terrible result.  But the truth is sometimes like that.  The answer to question 1 is still subjective, but at least we have succeeded in identifying a more specific point to discuss.  completeness The answer to question 2 is far less subjective.  In fact, removing arguments based on the quality of the elaboration work product, one could argue that answering question 2 is absolutely non-subjective.  Requirements elaboration completeness is identified when all elicited requirements are described sufficiently to transfer understanding of the requirement to the software documentation reader.  In other words, when each requirement is checked as complete by the software documentation author, and agreed as complete by stakeholder reviewers.

The Requirements Elicitation Completeness Conundrum

Question 1 is much harder to identify. The inability to identify the answer to this question, and the frustrations of teams that have tried, is a huge contributor to the industry-wide recognition of agile methodologies as a potential better way to work software projects.  Any attempt at identifying completeness can only take into account known issues. You simply don't know what you haven't yet discovered, and the best advice in assessing requirements completeness is to acknowledge this simple truth.  Don't get hung up on it.  Diligently attempt to elicit the known requirements, and plan to iterate early and often in order to catch the unknown requirements. 

It can become very costly when we try to completely identify all requirements of a software project up front.  This cost is not just in the analysis time we spend chasing perfection, but also in all the requirements that are identified in our quest, but are not really requirements. These requirements turn into software features that are developed, but never used.

Software teams should expend reasonable resources in identifying known requirements up front, elaborate those requirements to completeness, then recognize and embrace requirements change that comes from iterative understanding of the problem domain and iteratively incorporate changes as the unknowns become known.  This is scope creep, but it is not bad, and should be planned for.  Your team will fair far better technically and financially when necessary scope creep is expected, planned for, and then analyzed and documented as part of your iterative development process.

Tuesday, January 26, 2010
# Sunday, January 17, 2010
 #
Posted by Brian Haas on Sunday, January 17, 2010
 

It used to be that if you needed a quick business app you could fire up FoxPro or Microsoft Access, bang away for a day or two and end up with a solution to a problem that could actually be used.  With FoxPro already phased out and the future of Microsoft Access in question, software application frameworks are filling the void.computerscafolding

In the Microsoft development sphere, .Net development using C# or Vb.net is the most common answer given to replace the front-end client development features of Access and FoxPro.  However, when a developer starts up Visual Studio and creates a new project, they are a long way from a useable application.  Yes, all the pieces are there in the .Net Framework to build applications... good applications..., but application infrastructure is still needed as well and though you can go quite far with data binding and point-and-click wizards within Visual Studio, creating usable applications quickly will still require considerably more time and knowledge than past rapid application development platforms.  You can jump-start application development significantly by choosing and adopting an application framework product such as Component-based, Scalable Logical Architecture (CSLA) or StrataFrame.

Advantages of Choosing a Software Framework

There are many advantages to using an existing framework.  These include:

  • Rapidly Create Applications (After the initial learning curve)
  • Consistency of development practices across your applications
  • The infrastructure code is proven and you enjoy the benefits of more widespread usage and the mature code that arrives from such usage
  • Re-use of extensions you create for your specific application environments
  • A community of developers using the same technology to interact with and share thoughts and work

Building your own framework can provide a few of these advantages as well, but not all.  Whether you build your own or choose an existing framework, a framework will get you to writing code that actually addresses your application requirements faster. For developers and consultants that work on many different projects, the pace at which usable applications can be developed is often what judges your worth, and affects your income. Investing the time to analyze and learn the use of an existing application framework will provide an excellent return on your investment.

Sunday, January 17, 2010