Archive for July, 2007

Code Longevity: Development Efficiency and Code Fluidity

July 23, 2007

The goals of your development team is centralized around producing a feature-rich, secure, scalable, robust suite of software that can be sold out of the box to customers.

In order to accomplish that task development teams need to restructure how they look at projects. I’m proposing a new term called Code Longevity. Code Longevity means thinking about software development in terms of fluidness; how easy is the source code to change, adapt, and be repaired over time. Code Longevity requires code modularity, code documentation, standardization of code styles, and a flexible architecture. Successful software is not static, it is a living entity that grows and evolves through time

The software management team must anticipate the future applications of the product and realizing that building generic interfaces will allow the software to adapt to unknown directions the software may evolve. No software evolution cycles can be perfectly predicted due to outside variables therefore the software must be designed in the general case even though it may take more time to initially develop. After the time has been taken to create the general case of the software then the evolutionary line can make sharper, more agile changes in direction as there is minimal development necessary.

By modularizing our approach to software and creating a core asset collection of core components we are in a sense productizing our software source code. The core assets now act as component products, where developers can create extremely advanced application software without knowledge of the inner workings of the core assets. A developer can think about implementation and logic flow for their particular development goal rather than have to think about building the supporting tools (APIs and software libraries) that will make the goal feasible.


Network Link Detection in C#

This code snippit will show you how to detect if there is a network link on one of the network adaptors on your system. The function is written in C# and uses the Windows Management Instrumentation to get the link status.

It is ready to use, as is. It has been used on many projects, personal and professional.

/// <summary>
/// Checks if a network is connected to the local machine.
/// </summary>
/// <returns>true if network connected, false if not</returns>   

static public bool IsNetworkConnected()
{
    bool connected=false;     if(SystemInformation.Network)   

    {
        System.Management.ManagementObjectSearcher searcher=new System.Management.ManagementObjectSearcher
                            ("SELECT NetConnectionStatus FROM Win32_NetworkAdapter");
        foreach(System.Management.ManagementObject networkAdapter in searcher.Get())
        {
            if(networkAdapter["NetConnectionStatus"]!=null)
            {
                if((int)networkAdapter["NetConnectionStatus"]==2)
                {
                    connected = true;
                    break;
                }
            }
        }
        searcher.Dispose();
    }
    return connected; }

This For That: Addressing Vertical Markets with New Technology

July 20, 2007

There’s a lot of new technologies breaking on to the scene, especially in the Web 2.0 arena. The press and publicity seems to go to many horizontal players. While these groups have large broad impact, like traditional businesses they can’t serve every niche effectively. A horizontal approach gives you the center of the bell curve, but there are always outliers that have a lot of revenue potential. Look for under served verticals that you can address.

Here’s some examples of recent horizontal players:

  1. Facebook, MySpace for horizontal social networking
  2. Twitter, Pownce for horizontal micro-blogging
  3. YouTube, Revver for horizontal video sharing
  4. Google, Yahoo for horizontal search
  5. Flickr for horizontal photo sharing
  6. Scribd for horizontal document sharing
  7. Del.icio.us, StumbleUpon for horizontal bookmarking and site discovery
  8. Digg, Reddit for horizontal blog discovery
  9. Wikipedia for horizontal information archiving

And I’m sure you can name many others.

With players applying this Web 2.0 community based concept to so many horizontals, it begs two questions for the entrepreneur. One, are there any horizontals left without established players? And two, are there any vertical that are under served by these general, horizontal solutions?

Interesting, I think that there are still large opportunities in the vertical segments. Most of the services listed above do not have broad appeal outside of the technophiles who are in the know. There are millions of consumer and business Internet users who have never heard of some of these companies and services but who can get value.

My suggestion, find an under served vertical, maybe something you already know intimately and see if any of these new technologies can fit. Ask, can I use this for that?


Detecting Installed Microsoft .Net Framework (CLR) Version Information

It can be difficult to detect which versions of the Microsoft .Net framework are installed and available on a Windows device. This article presents a method to detect information about installed Microsoft .Net Framework versions.

In addition to describing the method this article provides a functional class to query and detect the installed CLR versions as well as a command line tool that will print out .Net CLR information.

Method

There is no simple function call in the .Net framework to detect versions of installed frameworks. This does make sense though, because in the case that .Net is not available it would be impossible to execute such a function call. C++ native code solutions do exist to perform this function and one such implementation can be found on Aaron Stebner’s MSDN Blog here.

The method used in the tool provided in this article is to enumerate the installed frameworks in the %systemroot%\Microsoft.NET\Framework folder, open the mscorlib.dll files, and retrieve version build information. These version numbers can then be looked up in a table of descriptions to provide information about the service pack level the .Net version is.

Command Line Tool

A command line tool to query the installed Microsoft .Net frameworks can be downloaded here. This Lowe*Software tool was written using the C# snippet below.

Note that this tool is compiled under Microsoft .Net Framework 1.1 and requires a version of .Net to run.

C# Code

using System;
using System.IO;
using System.Collections;
using System.Diagnostics;
using System.Text.RegularExpressions; 

namespace DotNetVersionInfo
{
    /// <summary>
    /// This class is used to retrieve information about the 
    /// Microsoft .Net Frameworks installed.
    /// </summary>
    public sealed class DotNetVersion
    {
        private DotNetVersion()
        {
        } 

        /// <summary>
        /// Retrieves the version of the CLR version the process is
        /// currently executing in.
        /// </summary>
        /// <returns>A string representing the CLR version.</returns>
        public static string GetCurrentCLRVersion()
        {
            return System.Environment.Version.ToString();
        } 

        /// <summary>
        /// Retrieves a description of a CLR based on version. This
        /// method will return information about service pack levels.
        /// </summary>
        /// <param name="version">A string representing the CLR version.</param>
        /// <returns>A description of the CLR.</returns>
        public static string GetCLRVersionDescription(string version)
        {
            switch(version)
            {
                case "1.0.3705.0":
                    return ".NET Framework 1.0 Original Release";
                case "1.0.3705.209":
                    return ".NET Framework 1.0 Service Pack 1";
                case "1.0.3705.288":
                    return ".NET Framework 1.0 Service Pack 2";
                case "1.0.3705.6018":
                    return ".NET Framework 1.0 Service Pack 3";
                case "1.1.4322.573":
                    return ".NET Framework 1.1 Original Release";
                case "1.1.4322.2032":
                    return ".NET Framework 1.1 Service Pack 1";
                case "1.1.4322.2300":
                    return ".NET Framework 1.1 Service Pack 1 (Windows Server 2003 SP1)";
                case "2.0.40607.16":
                    return ".NET Framework 2.0 Beta 1";
                case "2.0.50215.44":
                    return ".NET Framework 2.0 Beta 2";
                case "2.0.50727.42":
                    return ".NET Framework 2.0 Original Release";
                default:
                    return "Unknown Version";
            }
        } 

        /// <summary>
        /// Retrieves a list of versions installed on the current machine.
        /// </summary>
        /// <returns>A string array of installed CLR versions.</returns>
        public static string[] GetInstalledCLRVersions()
        {
            ArrayList versions=new ArrayList(); 

            string frameworkpath=Path.Combine(
                Environment.SystemDirectory,
                ;@"..Microsoft.NETFramework"); 

            string[] dirs=Directory.GetDirectories(frameworkpath, "v*.*.*"); 

            foreach(string dir in dirs)
            {
                try
                {
                    if(Regex.IsMatch(dir, "v[0-9]{1,5}.[0-9]{1,5}.[0-9]{1,5}.[0-9]{1,5}"))
                    {
                        FileVersionInfo verinfo=FileVersionInfo.GetVersionInfo(
                            Path.Combine(frameworkpath, dir + ;@"Mscorlib.dll")); 

                        versions.Add(
                            verinfo.FileMajorPart + "." +
                            verinfo.FileMinorPart + "." +
                            verinfo.FileBuildPart + "." +
                            verinfo.FilePrivatePart);
                    }
                }
                catch {}
            } 

            return (string[])versions.ToArray(typeof(string));
        }
    }
}

References

http://support.microsoft.com/default.aspx?kbid=318785

http://blogs.msdn.com/astebner/archive/2004/09/14/229574.aspx

http://blogs.msdn.com/astebner/archive/2004/09/18/231253.aspx


Don’t Shut Me In: On Switching Barriers

July 19, 2007

This is a philosophical discussion. In fact, switching barriers are one of the points that are argued during the open vs. closed information debate. Open-ness encourages trial of products and services while closed-ness encourages brand loyalty. As developers and entrepreneurs we have to look at out our philosophical view on information (our software, products, and services) and come to resolution with our business goals.

I was inspired by a comment I got on my post about Microsoft, Linux, and being professionally pidgeon-holed. The commenter brought up the point of “lock-in” when using Microsoft.

I agreed, and responded that people, like myself, are willing to be “locked-in” if the product or service provides some value, real or imagined. For example, look at the recent iPhone distaste about the AT&T contract. Look at the iPod and DRM. Look at your car and any modifications you purchase. Look at your gym membership. Though they create artificial ways of locking you in, all those products and services continue to flourish!
Corporations look to lock you in and create switching barriers to keep you loyal. They do it with termination fees (such as gym memberships), with investments in proprietary equipment (such as digital gadgets), by holding your data hostage (such as iPod/iTunes).

As entrepreneurs and developers we need to make these decisions all the time, do we use proprietary protocols or open standards? Do we use a third party proprietary software because it’s cheaper and faster? Do we follow our philosophical views and stay away from closed software and standards? Do we make it difficult for customers to switch?

Switching barriers are an important part of the competitive landscape. Look for barriers that you can create and figure out how to break down the barriers of your competition. Think hard when developing your business or your software, what barriers are you willing to create? What barriers will your customers tolerate?