Class to Add Instant ‘As You Type’ Filter Functionality to Infragistics UltraCombo Control

In my last blog post, I talked about a filter enhancement to a ComboBox that could be added to a single combo box with just one line of code. The blog post wasn’t necessarily to talk about the code, but was to talk about a good architecture and the importance of a good architecture for a system or application.

The filter component follows a sound architectural strategy as it is something that we could write once and easily reuse many times. Please see the blog post about the architecture here: Getting to the Monetary Value of Software Architecture

This post will focus on the actual class that was created in order to allow us to have this functionality.
The code was designed for WinForms Infragistics UltraCombo controls (v6.2 CLR2.0). These controls are multi column drop down lists, essentially. We’re using this control and not the native WinForms ComboBox because of the multi column ability. In this organization, we use a lot of Infragistics controls, but there are other vendors who make very good controls as well.

Before (without filter functionality):
image

After (with new filter functionality enabled):
image

(Some information in screen shots above is blurred out to protect customer confidentiality)

As the user is typing into the UltraCombo control the list filters based on what they are typing. In the example above the user has typed in ‘007’, so the list shows any items that have ‘007’ somewhere in the value. As the user is typing in order to filter, a filter icon is displayed in the UltraCombo. All of this functionality is encapsulated in the UltraComboTypeFilter class.

Here is the code for the UltraComboTypeFilter class that will give any UltraCombo control this functionality:

''' <summary>
''' Class is used to encapsulate functionality to allow user to type into 
''' ultra combo drop down and have the list display and filter the list as 
''' the user types 
''' Dan Douglas Mar 5, 2010 https://dandouglas.wordpress.com
''' </summary>
''' <remarks></remarks>
Public Class UltraComboTypeFilter
    Dim UltraComboControl As Infragistics.Win.UltraWinGrid.UltraCombo
    Dim KeyColumn As String
    Dim _FilterImage As Image

    ''' <summary>
    ''' Create a new instance of the UltraComboTypeFilter class
    ''' </summary>
    ''' <param name="UltraCombo">The Infragistics UltraComboBox control to apply the filter functionality to</param>
    ''' <param name="ColumnToFilter">The key of the column you want to be searched for filtering</param>
    ''' <remarks></remarks>
    Public Sub New(ByVal UltraCombo As Infragistics.Win.UltraWinGrid.UltraCombo, ByVal ColumnToFilter As String)
  
UltraComboControl = UltraCombo

        'Add handlers so that the methods in this class can handle the events from the control
        AddHandler UltraComboControl.KeyUp, AddressOf ucbo_KeyUp
        AddHandler UltraComboControl.AfterCloseUp, AddressOf ucbo_AfterCloseUp
        AddHandler UltraComboControl.TextChanged, AddressOf ucbo_TextChanged
        AddHandler UltraComboControl.BeforeDropDown, AddressOf ucbo_BeforeDropDown

        KeyColumn = ColumnToFilter

        FilterImage = My.Resources.FilterIcon() 'the filter icon is storred as an embedded resource in the resource file

        'turn off automatic value completion as it can potentially interfere at times with the search/filter functionality
        UltraComboControl.AutoEdit = False

        HideFilterIcon()
        UltraComboControl.Appearance.ImageHAlign = Infragistics.Win.HAlign.Right 'filter icon will be always displayed on the right side of the text area of the control

        ClearCustomPartFilter() 'by default, clear filters
    End Sub

    Private Sub ShowFilterIcon()
        'add the filter icon to the ComboBox
        UltraComboControl.Appearance.Image = FilterImage
    End Sub

    Private Sub HideFilterIcon()
        UltraComboControl.Appearance.Image = Nothing
    End Sub

    Private Sub ucbo_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        If Trim(UltraComboControl.Text) = "" Then
            ClearCustomPartFilter() 'if there are no characters in the textbox (from dropdown) then remove filters
        End If
    End Sub

    Private Sub ClearCustomPartFilter()
        'clear any filters if they exist 
        UltraComboControl.DisplayLayout.Bands(0).ColumnFilters.ClearAllFilters()
        HideFilterIcon()
    End Sub

    Private Sub DoPartDropDownFilter()
        UltraComboControl.DisplayLayout.Bands(0).ColumnFilters.ClearAllFilters()
        UltraComboControl.DisplayLayout.Bands(0).ColumnFilters(KeyColumn).FilterConditions.Add(Infragistics.Win.UltraWinGrid.FilterComparisionOperator.Like, "*" & UltraComboControl.Text & "*")
        ShowFilterIcon()
    End Sub

    Private Sub ucbo_BeforeDropDown(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs)
        'clear any filters if they exist before the user drops down the list, if the user starts typing again - filter will be shown
        'this is done so that if the user leaves the combo box and then goes back to it and drops down the list the full list will be 
        'there until they start typing a filter again; this is by design
        ClearCustomPartFilter()
    End Sub

    Private Sub ucbo_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
        'the code in this method is to start the filtering process to filter the drop down list if the drop down isn't 'dropped'
        'with thi procedure the user can just start typing into the combo box and have the box drop down automatically and filter
        'KeyPress event is not used because of timing issues - the timing of the event is too late for us to filter properly

        'Do not do filter or drop down if user hits ESC - also we will check other non entry keys like Left, Right, etc)
        ''Array of keys that we won't do anything with

        Dim IgnoreKeys As New List(Of Integer)
        IgnoreKeys.Add(Keys.Left)
        IgnoreKeys.Add(Keys.Right)
        IgnoreKeys.Add(Keys.Up)
        IgnoreKeys.Add(Keys.Down)
        IgnoreKeys.Add(Keys.Escape)
        IgnoreKeys.Add(Keys.Enter)

        If IgnoreKeys.Contains(e.KeyCode) = False Then
            'if inputted key press is valid for drop down filtering
            Dim iSelLoc As Integer = UltraComboControl.Textbox.SelectionStart 'get location of cursor
            If UltraComboControl.IsDroppedDown = False Then
                UltraComboControl.ToggleDropdown()
                'toggling drop down causes all text to be highlighted so we will deselect it and put the cursor position back where it was instead of being at 0
                UltraComboControl.Textbox.SelectionLength = 0
                UltraComboControl.Textbox.SelectionStart = iSelLoc
            End If

            DoPartDropDownFilter()
        End If

    End Sub

    ''' <summary>
    ''' The image to use for the filter icon shown on the control to be displayed while the control is filtered
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property FilterImage() As Image
        Get
            Return _FilterImage
        End Get
        Set(ByVal value As Image)
            _FilterImage = value
        End Set
    End Property

    Private Sub ucbo_AfterCloseUp(ByVal sender As Object, ByVal e As System.EventArgs)
        ClearCustomPartFilter()
    End Sub

    Protected Overrides Sub Finalize()
        RemoveHandler UltraComboControl.KeyUp, AddressOf ucbo_KeyUp
        RemoveHandler UltraComboControl.AfterCloseUp, AddressOf ucbo_AfterCloseUp
        RemoveHandler UltraComboControl.TextChanged, AddressOf ucbo_TextChanged
        RemoveHandler UltraComboControl.BeforeDropDown, AddressOf ucbo_BeforeDropDown
        MyBase.Finalize()
    End Sub
End Class

Now, to enable the functionality on any UltraCombo control just use one single line of code.

Dim PartFilterFunction As New UltraComboTypeFilter(ucboPart, "CustPartNo")

Add the filter icon/image as a resource to the project that contains the UltraComboTypeFilter class and name the resource FilterIcon.

Advertisements

Getting to the Monetary Value of Software Architecture

Software Architecture is a huge topic and it’s something I am passionate about. I believe, and can prove, that continuous improvement in this area will contribute to overall better system design, faster bug tracking and fixing, reduced maintenance time, faster development time, developer happiness, quicker time to market, and allowing you to allocate more time to keep up to date on the newest technology – to name just a few things….

Now, translate this into the Bottom Line of the Business….

  • Faster ROI for software projects
  • Reduced Downtime
  • Faster time to market for new features
  • Reduced labour costs on software projects where the additional labour can be put towards additional stages of the project or other areas
  • Bottom Line -> Reduced Costs, Greater Profits

Let me share a case in point that compliments this theory nicely along with details to indicate the higher monetary value of the well architected solution …..

I’m going to discuss a feature we added to an existing project and how it was implemented using a sound architectural strategy. This is just a small piece, an enhancement really, to an existing system that has been well architected.  

We developed a solution to allow users to search and filter a combo box while typing into the text area of the combo. This allowed users to find what they were looking for faster. The before and after scenarios are contrasted below…

Before:

User had to know the complete item name in the list of potentially thousands of items and carefully scroll through the list to find the item.

image

After:

Users only need to know part of the item name that they are looking for and just have to type it into the ComboBox to filter. This is an incredibly quick and easy feature for the user and eliminates time required for them to scroll through the list. As an added feature, a little filter icon is shown in the combo box to denote that the combo box list is only showing items that match the filter criteria.

image

(Note: Some data has been blurred to keep certain customer information confidential)

As you can see above, the user just types in ‘007’ which is the suffix to the part they were looking for in the list. This enabled them to quickly find what they were looking for; in this case, only one part had that specific suffix. In this case, there are over 240 items in the drop down list that the user would have to navigate through to find what they were looking for if this filter functionality was not in place.

Implementation Scenarios

I could have implemented this in many ways, but I decided on an architecture that would allow me to reuse this functionality many times over with little effort. I created a class that encapsulated all of the functionality required for the filter functionality to work. This approach requires no additional filter specific code in the main application. With this new class (about 64 lines of new code), I can create a new instance of it in any project and have instant and seamless filter/search functionality for any Combo Box.

It’s now literally one line of code to add this functionality (essentially 64 lines worth of functionality) to any of our ComboBoxes. You could loosely (very loosely) say that your productivity is increased by 64 times when implementing this filter functionality in any new scenario using this approach. However, read further and I’ll cover a more accurate metric.

I’ll contrast this implementation scenario with another very common scenario:

clip_image006User: “This application is great, but man it sure is hard to find the information I need sometimes – especially when I only know the suffix to the part I am looking for”

clip_image008 Developer: “I have a great idea, let me add filter functionality for you to search your list and find what you need. “

clip_image009User: “That sounds great! That’ll save me a ton of time!”

The developer opens the project and finds the Combo Box he is going to add the filter functionality to and starts coding away by handling the events of the Combo Box, adding code to various places, debugging, and a few hours later he has something that works pretty well. He/she does a bit more testing, fixes some bugs, makes a few changes, and here we have something that seems to be perfected.

The change is rolled into production and the users LOVE it! They can think of how useful it would be to have this functionality on a few more Combo Boxes.

(this is where it all goes wrong)

The developer goes to add this functionality to a few more Combo Boxes. For each combo box the developer is doing the following:

1) Find all the code in another area of the application that has the filter combo box functionality and copy it …. (“Where is all the code I need?  Grrr – which pieces of it do I need again?”)

2) Paste it into the code module in another area of the application where the new functionality is needed

3) Look through all of the code and replace control names, key strings, and other variables with the ones we want to use for this instance

4) Test everything to make sure we aren’t missing anything

5) Ooops, something is not working right – maybe I forgot to copy something or change a value somewhere?

6) Ahh found it, I didn’t handle one of the events of the Combo Box properly and this was causing all kinds of problems

7) Copy and paste this piece of it

8) Code has been added in various places to support this new functionality, I need to do some serious integration testing to make sure I didn’t screw something else up

9) Ok, finally, everything is a go – let me post this.

Now the user wants the functionality in a few more places. The developer finds this tedious, but continues to do it this way for each combo box. This is tedious and time consuming and introduces more opportunity for bugs due code integrated into multiple places and tightly coupled within the system; due to time constraints it becomes tougher to introduce this functionality in too many additional areas.

With the well architected solution we get the following direct benefits that we would not see in the above scenario:

  • Write once, reuse many times – easily!
  • Effort does not need to be repeated for each place we want to use this functionality
  • Changes to functionality are made in the Class and bug fixes and enhancements do not need to be manually replicated for as many times as the functionality has been implemented
  • Code is refined, tested, and encapsulated from the rest of the project and from the ComboBox itself
  • Test Driven Development is supported as the idea is to de-couple the functionality from the system so that it can be reused – this decoupling makes it easy to write automated tests if necessary
  • Testing of the main components limits any re-testing required because the code is always the exact same code and not just copied and re-integrated from place to place


How can we put a monetary value on this?

Now, add up the time it took to create, test, and debug the initial filter component and get it working once. This is your Y value.

Now, add up the time it takes to copy the functionality to one more area as per the steps listed above and multiply that by the number of times you need to duplicate the functionality. This is your X value.

Now, come up with a number as to how many places could benefit from this new introduced functionality. This is your N value.

Now, add up the time it takes to add one line of code to a project to enable this filter functionality on an additional Combo Box. This is your Z value.

Cost of a well architected approach to implement: Time = Y + (N x Z)

Non architected solution: Time = Y + (N x X)

This just shows the initial up front cost savings. Take the other benefits into account, as listed above, and you can see a much higher monetary value.

To Add Insult To Injury…..

Now, wouldn’t it be great if we could have the filter search all of the columns for the combo box instead of just the one. We could just add a new option to the class to allow that or enable it by default for all ComboBox’s using the filter. Let’s hope they are all using this architecture – I don’t know a developer who would enjoy going back and modifying (or adding) the code for every combo box so that it can support this extra functionality. Unfortunately, in that scenario you’ll have added unnecessary labour cost to the project to get this additional functionality or the functionality just wouldn’t be added and the feature set of the system would suffer.

In a follow up blog post, I’ll actually discuss the code used and the approach taken with the code for this solution in particular. I will however share, in this blog post, the one line of code required to duplicate this functionality (64 lines of dispersed code, reduced to 1):

Dim partfilter As New UltraComboTypeFilter(ucboPart, “PartNo”)

IT Training and Justification

As IT professionals we need to be continually up to speed on new technology and continually striving to become masters of existing technology.  It doesn’t matter if you are a developer, systems analyst, business analyst, IT architect, whatever – to be at the top of our game we need to continually challenge ourselves in new ways and continually add to our skill set.  IT professionals learn things every day – we learn by doing, reading articles, writing blog posts, talking to peers, attending community events, classroom training, online training, etc.  Sometimes there is a huge benefit to attend a professional training class that could be anywhere from a day long to five days long.

It’s easy for IT professionals to “know” that we require training in a certain area – sometimes it takes some time to think about how we can actually justify the training.  If you or your company are paying for the training you might want to make sure that the training will be beneficial and valuable and, if someone else is paying for it, communicate the potential value or ROI of the training.  This will take some thinking, but it’s a good exercise none the less.   Think that training costs are easily between $2,000 to $5,000 (or more in some cases) a week for the training + travel and accommodations if required.

I came up with a quick template that could be used to justify training – weather you plan on justifying it verbally or on paper to whoever is approving the training this kind of template may help.  Of course, if you only need to justify it to yourself then you wouldn’t need this – or if the person signing the checks is ‘easy’ then you may not need this either ;)  Of course, I would never expect someone to just copy this template and fill in the blanks (unless you are a mindless drone) – it’s not meant to be a formal letter either, but just meant to give an idea of the type of ammo to bring with you if you are trying to justify training for yourself or your team.

The {length of training} {course name} training program being held at {location/building} focuses on creating the proper architecture of software solutions and familiarizes us with creating architectures for newer technology.  Continuous training in the area of Software Architecture will allow us to be able to better architect and develop our solutions for {Company Name}.  Solutions with a great and solid architecture have fewer bugs and allow features and improvements to be added with ease and with less time.  The advantages of this have been seen with {explain how value has been added to an existing project due to past training or knowledge in the specific area you are seeking training – try to include real numbers and hard values if possible}.  This ease of integration freed our time to focus on the core functionality of {Reference same project as above} rather than building all of the pieces from scratch.

As new technologies emerge we need to be able to take advantage of them in order to continually create better systems with a minimal learning curve.  This training will allow us to make better decisions on the use of technology in our solutions and gives us a better understanding of the best way to implement the technology to meet both current and long term objectives.  Better decisions up front when building a solution means less time and money required to initially develop the solution, add features, and expand functionality.

Toronto WinMoDevCamp Coming November 11, 2009

Anthony Bartolo from Microsoft asked if I’d help spread the word about the Toronto WinMoDevCamp coming to Mississauga on November 11, 2009.  It’s free Windows Mobile development training, and it’s hosted by Microsoft.

It looks like a fantastic event!

image002

 

Learn about Windows Mobile Development at WinMoDevCamp Toronto – November 11, 2009 

Interested in learning how easy it is to build applications for Windows Mobile? Want to know more about getting your app in the Windows Mobile Marketplace?

WinMoDevCamp is a series of not-for-profit gatherings to develop applications for the newly released Microsoft Windows Phone 6.5 O/S. Attendees will include mobile developers, web developers, .Net Developers, UI designers, testers, device manufactures and Canadian Carriers, all working together. Development projects will include both solo and team efforts. While some attendees will wish to work solo during the event, we encourage attendees to team up, based on expertise, to work in ad-hoc project development teams. All attendees should be prepared to work on a development project during the event.

  • Create new applications for the Windows Mobile Platform.
  • Meet and work side-by-side with team members from the
  • Microsoft Mobile Developer Experience team.
  • Gain assistance in migrating existing mobile applications from the iPhone, Blackberry and Palm Pre to the Windows Mobile Platform.
  • Create applications to support Windows Enterprise Applications.
  • Interact with Canadian Wireless Carrier representatives
    (Bell, Telus, Rogers & WIND)

Many thanks to the Microsoft Mobile Developer Experience team for their support in making these events happen! I want to specifically thank Loke Uei, Senior Technical Project Manager on the Microsoft Mobile Developer Experience team for not hesitating in giving his full support to the community.  Register here: http://bit.ly/3E7Emm.

 This Just In!

—————————————————————–

Gentlemen,

Also I just announce three Call of Duty Prize give-a-ways (One is the complete XBOX 360 Modern Warfare Console) for WinMoDevCamp Toronto.  I have posted details on my blog here:

http://wirelesslyobsessed.com/2009/11/10/winmodevcamp-toronto-call-of-duty-modern-warfare-2-give-a-way/

Screencast: A ‘Hello World’ Example of .NET Reflection in Action

As part of my presentation at the October 2009 London .NET User Group event on .NET Attributes and Reflection (see: https://dandouglas.wordpress.com/2009/10/25/my-talk-titled-net-attributes-and-reflection-what-a-developer-needs-to-know/ ) i did a walkthrough on how to use .NET reflection.

This demonstration walks you through the source code of creating a late-bound instance of a class from an assembly that was instantiated using reflection methods.  Once we have the instance of the class created we use reflection again to call one of its methods.

Click this link to view the screencast recording from the presentation:  http://www.screencast.com/t/XtlsjQCldFR

I do not yet have the source code available to download because wordpress.com doesn’t allow me to post a .zip file.  Once I find another location to post it, I will share the link.  In the meantime feel free to contact me for it.

Dan

Screencast: Redgate .NET Reflector Demo From My Last Presentation

In a follow up to my last post, I talked about Redgate’s .NET Reflector during my presentation at the London .NET User Group event last week (see: https://dandouglas.wordpress.com/2009/10/25/my-talk-titled-net-attributes-and-reflection-what-a-developer-needs-to-know/ )

I recorded the entire presentation using Camtasia Studio, but here is just a snippet from the presentation. A small piece about Redgate .NET Reflector and a little demo on how to use it and how it works.

Check out the screencast here:

http://www.screencast.com/t/e300Ok5eh7

The volume is a little low at the beginning because I was using my laptop mic as the audio input and I had walked away from the laptop while presenting the slide.  Once I got into the demo, I was right at my laptop so the audio quality is much better.

Dan

My Talk Titled, “.NET Attributes and Reflection – what a developer needs to know……”

On October 19, 2009, the first official meeting of the London .NET User Group met at Fanshawe College.  There were at least 45 people attending!  Great job Tony

Including my presentation, we also had a presentation on ASP.NET MVC and the featured presentation by Rob Labbe from Microsoft (security consultant from the ACE team) on Web Threats and how to Mitigate them.  Rob is a fantastic speaker and really captivated the audience. 

My presentation ran about 22 minutes including a couple of Q and A’s.  Here’s the link to the PowerPoint as well as the source code I used for the live example of .NET reflection in action.

https://dandouglas.files.wordpress.com/2009/10/dotnet-reflection-oct-2009-fcdnug.pptx

Here are the live recordings (screencasts) of the 2 demos I did during the presentation:

Using .NET Reflection In Code Demo  https://dandouglas.wordpress.com/2009/10/25/screencast-a-hello-world-example-of-net-reflection-in-action/

Redgate .NET Reflector Demo   https://dandouglas.wordpress.com/2009/10/25/redgate-net-reflector-demo-from-my-last-presentation/

Here’s a link to the write up of the event on the user group home page.  It includes a few pictures as well. http://www.forestcityasp.net/post/2009/10/21/Hack-And-Defend-Session.aspx

Hmm – well I was about to upload the .zip file for the source code of the reflection example I walked through as part of the presentation, but unfortunately wordpress.com doesn’t allow me to upload zip files.  :(  I’ll try and figure out an alternative place to upload them.  If anyone wants them in the meantime just let me know and I’’ll arrange to send the samples to you.

Also, as of today I’ve joined the Executive Committee for the London .NET User Group.  I’m looking forward to it!

My Video Interview From TechDays Toronto 2009 (SharePoint and BI)

On the final day of TechDays 2009 in Toronto, I was interviewed by It in Canada (http://www.itincanada.ca) about my experience at TechDays and specifically about one of the sessions involving BI and SharePoint.  I’d like to share the link to the interview.  It was completely ad-hoc and they caught me at the end of the day, and after asking me a few questions about my experience at TechDays they asked me if I’d like to do an interview.

It’s part of something called “The Efficiency Platform” and is sponsored by Microsoft.

You can get to the video from the main site by scrolling to the bottom of the page.  They have a little sub site there at the bottom where you can scroll through the videos.  Mine is listed as SharePoint with Dan Douglas

This direct link also works to direct straight to the video with no bells and whistles.

http://www.qmpmedia.com/tv/itvideo.php?vid=130&ser=itc&sor=1&cat=

Near the end of the video the background noise really seemed to pick up, so you might need to adjust the volume to hear everything properly at the end.

Screen shot from the site:

image

Dan

My Experience With the VS 2008 Documentation…..

I was using Visual Studio today, like I do most days J, and I wanted context sensitive help. I thought, maybe I’ll try it – I haven’t used it in a while and I know Document Explorer 2008 is installed as well (this is a newly built Win 7 development box). I remember the value of the MSDN Library back in the VB 6 days, but as we got into VS.NET, VS.NET 2003 and so on, it seemed the MSDN Library took a wrong turn somewhere. It was slow and typically gave us pretty irelevant infrmation.

So, I was looking for help on a .NET method I was planning on using (I don’t recall the exact method) and I clicked on F1 to bring up help in the MSDN Library. I knew the .NET MSDN Library files were not installed, but I set the MSDN Library to look online first for content. I figured this should work ok without having to install the files locally as it was looking online. Wrong! “Information Not Found!” L Crap…..

So, I thought – meh – I’ll just suck it up and install the entire .NET MSDN library to my hard drive. After installing a couple gigs of data to my hard drive I was ready to roll…. I thought….

I wanted to take it for a trial run, so I started selecting code in the Visual Studio editor and pressing the F1 key. I selected Add from the Data Dictionary object of the Exception class hoping that it would be accurate and give me context help on the IDictionary.Add method.

To my disgust :), I got help for some Add method in the Office API L

Grrr. After trying a few more and noticing I was getting completely irrelevant results, I thought I must be missing something.

I tried it again, and in this example I left the carot on Add but didn’t highlight the text and then clicked F1.

Presto! Well not quite, because the documentation gave me results for Silverlight for some reason – but hey – it’s pretty close!

L

What I Learned At TechDays 2009 Toronto! Part 3

This will be my last post in my Tech Days 2009 blog post “series” or “trilogy?”.  I just finished soldering some wires for my car stereo – I can listen to my iPod in my car again :) … Now, I figured I could score a few minutes (well much more than that) of free time while supper is cooking, so here we go with my last update on my experience at Tech Days 2009 in Toronto.

In a quick update to yesterday’s posting What I Learned At TechDays 2009 Toronto! Part 2 Business Intelligence where I talked about the BI session and how useful the session was to me.  Today, I’ve started going through Analysis Services and Integration Services in more detail than I ever had before.  As already planned, an Analysis Services and Integration Services implementation will be a part of our SQL Server 2008 migration (migrating from SQL Server 2000).  I’m currently setting up some proof of concept Analysis Services projects in our SQL Server 2008 test environment that will allow me to demonstrate the power of Business Intelligence to our power users.

Before I had attended this session at TechDays I was aware of these services as well as Microsoft’s BI option in general.  I’ve dabbled in it before and have watched demos and played around with it, but now I have a renewed interest in this – especially since we have some great projects in the works where strong Business Intelligence will be a powerful addition.

Ok, so on with the new.  As continued from my previous postings, I want to briefly discuss a few more of the sessions I attended at TechDays 2009 Toronto.

3. C# Advanced Features

In the “Going From 0 to 100 Dollars Per Hour with the .NET you never knew” session, I had the opportunity to see explanations and examples of advanced C# language features.  The presenters did a great job in explaining the content, and I definitely learned a few things.  Some of the features that were discussed such as Best Practices for Exception Handling and Generics, I already am taking advantage of and using quite often.  I’ve found generics to be extremely powerful and really can add a lot of value to the architecture of an application.  One interesting point that came up was that “Exceptions are for exceptional errors, not for process flow”.  Although I agree with this, I have (once or twice), by design, had my data layer or facade layer raise it’s own custom exception that signified that, for example, a duplicate entry was being added and told the UI to “change course” and notify the user that this is not allowed.  I didn’t (and still don’t) see any real harm in this :).

Some other things discussed in this session are things that would be useful in some scenarios and can contribute to a great architecture, but you just need to know when and how they should be used in cases where they will add value.  Let me briefly mention these things along with the big “take-aways” I took from each item.

  • Anonymous Methods – Keeping method concerns from leaking into class interface – don’t use for repeatable logic
  • Lambdas – Not for anything re-usable; like an anonymous method on steroids
  • Extension Methods – Add behaviour to types without modifying types –  Good for string manipulation, enumerations
  • LINQ To Objects – The SQL of Collections
  • Closures – Powerful way of creating delegate with context

4. Team System

The “Database Change Management with Team System” session was important, because I think (like us) there are many people using Team System (and TFS) that are not using it effectively.  At the beginning of the session, the question was asked “How many people in the room have a good change management process?” – no one in the room raised their hand – and the room was packed!

We’ve been using Team System and Team Foundation Server for years, and it’s a big improvement from Visual Source Safe; we are familiar with work items and bug tracking, etc, but we still aren’t getting the best value out of it.  This session explained various important features that would be valuable to our organization.

  • Branching – This is probably one of the biggest areas we could add value to.  We don’t currently branch effectively and with TFS you can branch and merge quite well.
  • Managing Change Sets
  • Work Items
  • Classifications
  • Build Automation

The ideas presented in this session will be useful in improving our processes around Team System.

5. Layering

I’m all about layering really.  I’ve done a few presentations on layering, but in the “Layers – The Secret Language of Architects” session I learned about some new things as well.  By the way, the title of this session holds true, in my opinion – layering is one of the fundamental cores in software development that an application architect should understand.  This session, by Adam Dymitruk along with John Bristowe, touched on some new topics for me, including, MVVM (Model-View-View-Model) which has been recently introduced by Microsoft but is not yet standardized.  This session also touched on the following topics (ASP.NET MVC, Domain Model, Design by Contract, Domain Driven Design, and more).  Domain Driven Design really interests me and I am in the process of learning much more about it.

It was also strongly recommended that you check out MSMQ as it is very useful for message queuing.  This is something I’ve used a little bit and I will agree can be pretty valuable.

This was a great session as it introduced different layering models and design patterns used for an application architecture.

So, that wraps up the top 5 sessions (in no particular order) that I attended from TechDays 2009 Toronto.  If anyone reading this has any comments on any of the three articles I would welcome them very much.  I’d also welcome any comments on how I could improve this type of blog posting in the future.

(I know I left some names out – credit to many of the points listed above goes to the individuals presenting the content – I am hoping to get names to fill in more of the details about the individuals doing the presentations – I didn’t write them all down)

 

Dan

What I Learned At TechDays 2009 Toronto! Part 2 Business Intelligence

In follow up to my last article What I Learned At TechDays 2009 Toronto! Part 1 Windows Mobile 6.5, in this article I will talk about the session I attended on BI.

At the end of the final day of the event, I was video-interviewed by ITInCanada.com about my thoughts on TechDays 2009 Toronto and my specific thoughts about what I took away from the session on BI.  The interview required some quick thinking, but I feel I did well for an impromptu 3-minute interview.  The point I made at the end of the interview, that I’d like to re-iterate is that when attending an event like this it’s important to really think about the sessions in terms of value to the organization – and how you can use the information and advice to bring value back to your organization.  When I get the link to the video I will post it on my blog.

Ok, so I’d like to move on with more of my “take-aways” from TechDays 2009 Toronto –

2. Business Intelligence

I took a lot out of the  “Using Microsoft Dashboards, Scorecards, and Analytics to Monitor the Health of your IT Infrastructure” session, and for me, it was probably one of the most valuable sessions I attended at TechDays this year.  It focused on Micorosft’s BI offering, and also used practical examples of using BI for monitoring the health of your IT infrastructure (as repeated from the title of the session :))

I feel there is a large amount of value for good Business Intelligence, especially in my current organization (a global automotive parts manufacturer).  We have some power users that can do incredible things with Excel as is, but they’ve also become incredibly reliant on IT to provide them with all kinds of custom reports, graphs, etc.  I’ve seen the work they can do with data analysis and charting data in Excel, and if we empowered them to take advantage of data, that lets say we make available through Analysis Services, they would have a plethora of data at their disposal to easily consume, chart, and analyze in Excel or other tools.  This would take strain off of IT development in providing reports along with many custom reporting options and allow users to create, share, and manipulate the exact data reports and charts they need.  We have a global corporate intranet hosted at our head office that is SharePoint based that would be a perfect location for users to manage and share this content that they create.

The demos in this session were great.  I got a good look at how to use Excel 2007 to analyze analytical data from Analysis Services.  It was literally drag and drop, point and click, to embed and aggregate this data in excel as a chart or table.

There was a lot more to this session as well, and it dug pretty deep into using Integration Services, Analysis Services, Cube Design, Star Schema, Data Source Views, Fact Tables, SharePoint, PerformancePoint Server, etc – each of these technologies can contribute to making a BI solution work!

– to be continued –

What I Learned At TechDays 2009 Toronto! Part 1 Windows Mobile 6.5

TechDays Toronto 2009 wrapped up nicely on Wednesday, and I’ve finally had a chance to go through and review my pages and pages of notes (writing, diagrams, and chicken scratch).  I learned a lot at this event, and I’m planning on blogging a few posts over the next few days about it.  I find that just by blogging and thinking about the things I wrote down at the event helps me to retain a lot more than I would have otherwise, and it gives me another opportunity to think about these topics more deeply.

Ok – before I get to the sessions, let me start with lunch –> Lunch the 1st day was satisfactory at best, but lunch redeemed itself on the second day with the Chicken Salad Sandwich.  There were some booths and tables set up outside the lunch area demoing products and other things, but I didn’t see much there for developers – albeit I gave it a quick “twice-over” and didn’t look too deeply at any of the tables.

The power of Twitter!  I’ve been able to get involved with the TechDays twitter conversation with the tag #TechDays_ca – this was a powerful way to connect with many people attending the event and also many of the speakers and organizers.  I’d recommend to anybody to hit up the Twitter bandwagon.  I use TweetDeck to manage my tweets and twitter conversations.

So, in no particular order, I want to talk about some of the top things I learned and that interested me the most….. Let me start with the Windows Mobile Session…..

1.Windows Mobile 6.5

 In the “Taking Your Application on the Road with Windows Mobile Software” session, Mark Arteaga and Anthony Bartolo did a presentation on Windows Mobile 6.5 development and the Windows Mobile Marketplace.  This was a session I was really looking forward to, and it didn’t disappoint.  I have done some mobile development as it relates to the manufacturing environment that’s mostly related to data collecting, bar code scanning, etc.  I’ve done some interesting things around queuing to local SQL databases when the server is unavailable and things like that.  However, in this session Marc explained things in Windows mobile 6.5 that were just completely cool, but not only cool – practical demos and applications were also discussed.  The potential with Windows Mobile 6.5 is really exciting.

Let me summarize the key points, from my notes, that were most interesting to me:

Fake GPS

  • Used for development of GPS enabled applications
  • Emulates a physical GPS
  • Uses a text file for reading raw GPS data

Cellular Emulator

  • Integrate with Pocket Outlook (contacts, email, SMS, appointments, tasks)
  • In the development environment (Visual Studio .NET)
  • Send phone calls to the emulated phone
  • Send SMS messages

Windows Mobile Marketplace

  • Launch to coincide with the release of Windows Mobile 6.5
  • A market place for developers to sell their applications to Windows mobile users (my impression is that it will be similar to the app store on the iPod)
  • Developers get 70% of money for the purchase of the software by consumers.  Microsoft gets 30% which goes directly into the infrastructure of the Marketplace

WM 6.5 & Misc

  • Full IE browser with the same capabilities as the desktop browser (Note: This is a huge feature in my opinion.  I’m a Windows Mobile user and the browser is very limited.  Although I hear positive things about Opera, my experience with is has left me wanting to go back to Pocket IE)
  • Gestures (I can see these touch gestures being useful and allowing the developer to create better mobile apps with native gestures built in for flipping, panning, etc)
  • Widgets – similar to gadgets available in Windows XP
  • System state – trapping phone calls, SMS, media player song information, etc
  • Accelerometer available on certain devices – Unified Sensor API is available on codeplex
  • GSensor – Shake and Drop detection

Although I don’t see the new features having a big impact right now on the type of mobile application development that I’m currently involved with on the shop floor, there is definitely potential in the future as more device manufacturers provide hardware that is compatible with the latest Windows Mobile OS.  The move to include a full IE browser, as I understand it, will give the mobile device the same IE functionality as with a desktop PC, but I don’t believe that this functionality will take away from the types of applications that are currently developed natively for Windows Mobile (versus running in a browser) using .NET, C++, etc…. but in the realm of mobile browser based applications this is a huge step forward.  It also guarantees that any existing website should work on the mobile browser – however, if it is not customized for the mobile screen display resolution it may not look correctly or will require you to pan and scan the page.

I do see a huge impact for mobile development in the areas outside the shop floor environment with Windows Mobile 6.5.  For anybody interested in (or currently) developing mobile applications on the .NET framework, WM 6.5 is very promising.  Based on what I’ve seen, the quality of available applications should be increased with WM 6.5, and time to market from development to production will likely be able to decrease due to the addition of new native functionality.

At the end of the session they gave away Rock Band Beatles Edition to the winner of an audience competition where audience members got up in front of everyone to describe the mobile application they’ve been working on.  Cool!

To be continued – I will post again shortly about some more things I learned at TechDays Toronto 2009.

Dan

TechDays 2009 Toronto Tomorrow …. (and a blurb about Lean)

I’m sitting in my hotel, and I just finished a very salty Prime Rib sandwich – although it was pretty delicious until the last couple of bites, I just couldn’t bring myself to eat the last few bites due to the ridiculous amount of salt.  I spent a fair amount of time walking around downtown Toronto trying to find a restaurant to eat at before just deciding on the one back at the hotel…  this should be a lessons learned – just eat at the hotel :( … There really aren’t many restaurants within a few blocks around here anyway. 

Tech Days 2009 (Toronto) starts tomorrow, and I’ll be up early to catch breakfast there.  I’m looking forward to the sessions and I’ll blog about the highlights in the next few days.

On another note, although I’ve seen it many times, I love the Toronto skyline – especially driving down the Gardiner into Toronto.  Although, not everyone shares this opinion (M), you couldn’t have asked for a better addition to the CN Tower than the lights they added to it a few years back. 

While driving down I listened to the first CD and part of the second CD of the audiobook titled “Lean Thinking”.  I started thinking about lean and waste as it pertains to 1) The Manufacturing Environment where I am working 2) Waste and process improvement within our IT department, but specifically speaking of waste within software development. 

It’s amazing, when I think about the effort that we’ve put in over the last several years focusing on decoupling, architecture, design patterns, reusability, etc and how it has contributed to much less waste, less defects, and allowing us to focus on increasing customer value.  However, there is so much more we can do, and as I’ve been listening to this audiobook ideas are popping in my head like crazy.  Lean is much more than “Lean Manufacturing” – Lean Software should definitely be something we strive for.  Over the next few months look for a few more postings on my ideas about Lean Software.

 

Dan

The Art and Process of Reusability in Software Development

Reusability is the art of planning and developing application components so that they can be easily reused in other areas, be easily built on top of, and provide a decoupled approach to development and testing,

When developing software and writing your code, a great amount of care has to be taken into consideration on the subject of reusability.  The first question you should be thinking about is:

Which components do we have available to use that have already been developed?

So, we’re thinking about which components or software code that have been developed already that we can reuse (either within the same application or a new application).  Components in this context, could mean any of the following scenarios:

1. Code that we have available that wasn’t necessarily designed to be reusable:

This is code that we may have developed within another application without really thinking about it’s reusability, and even though it wasn’t designed to be reusable we can still harness the value of the code.  Depending on the situation we could abstract the code from the original location and make it reusable – this would be important to do if you can really see this piece of code or component being reused again and again.  This requires modifying the original code or component and the application using it in order to get the abstraction.  The original application will now use this component and your new application will be reusing that exact same component.  Improvements to the component could now affect both applications.

Another option is the good ol’ copy and paste method.  Bad, Bad, Bad!  Well sometimes it’s bad – not always.  Go in to the other application, select what you want to copy, and paste it into the new application – modify as needed.  Presto!  We’ve all done this, and it can be justified if the effort required to copy/paste/modify as many times as you project you will ever need this code is much less than the time it would take to decouple it.  Sometimes you may just do it to be lazy – hopefully if you do it due to laziness it doesn’t bite you in the ass the next three or four times you want to re-use the same code again – wishing you’d have decoupled it from the get go.

Sometimes, you may have code or components that you want to reuse but you are having difficulty decoupling it from it’s original source.  Reusability wasn’t taken into account when the code was originally written and it’s too tightly coupled to the original application.  The reusability factor here is lost and typically you have to duplicate the effort and re-write from scratch into a new application.  Now, hopefully the second time it gets written – it’s designed to be reusable.

2. 3rd party components we can plug into our application:

There are tons of time saving components from 3rd party vendors out there that we can plug into our applications.  These components typically provide functionality that is not native out of the box functionality for your application.  Some examples of available third party components are:  Data grids, ORM mapping, charting, reporting, etc.  These can provide an enhancement to your applications that will save you development time in exchange for the licensing fee of the component.  Purchasing new 3rd party components can be time consuming as you want to do an extensive search and evaluation on competing components from many vendors before making a purchase decision.

3. Using free source code or components found online:

There are many great source code examples and free components available online that you can plug into your application.  These can be a real timesaver, but typically should be thoroughly tested before production to a greater extent than other components as they typically provide no warranty and can sometimes introduce very unexpected bugs if you are not careful.

 

Ok, so you’ve thought about the ideas above but still feel you must begin development with new code – you now need to think about future reusability of the code you are writing.

I’ll get into more detail about developing for reusability in Part II of this blog posting.  Coming Soon!

Beginner Developer Lesson: Maintaining the Link to Historic Data in a Lookup List

I was thinking about the basic concept of showing data in your applications that is both relevant and historic.  This is a beginner lesson in software development, but it’s still an important design decision that needs to be looked at in the conception of a new feature or application.

Historic data needs to be maintained and it can take many forms.  In this posting I want to briefly describe a method that can be used to preserve historic information that is found in lookup lists.

Information in a lookup list can be anything from a Category Item to an Employee Name or many other things.  The problem is that some of these items can become obsolete or in the case of an employee name lookup list, the employee could leave the organization.

Typically when creating a lookup list in a database I’ll create a lookup table and have a bit (Boolean) field named archived, with a default value of 0(false), that will denote an item that is used or no longer used.

image

If there is any expectation or future requirement that a lookup item could become obsolete or deprecated then it’s important to include an easy way to remove the item from being used in the future, but you still have to allow the preservation of historic data.  You do not want to delete this item from the list completely as you will lose any historic data attached to the item. 

You just want to set a flag and archive/deprecate it.  Being able to set this flag at the database table level should be enough so that you do not have to do any code modifications or other changes to support this in the future.  It should be built from the get go, and you could always have the option to go a step further and build an interface and allow your users to do it from the application – but that is out of the scope of this article. 

Once you have the infrastructure in place at the database table level you data could look something like this:

image

So, in the above screenshot you can see we have a lookup list for Category that has one archived item named Assembly.

Now, it makes sense that all reports and records that are using the CategoryID of 1 (Assembly) in their records to be able to maintain this, but new items should not be able to use the Assembly category.

Now that the groundwork has been laid, the following important guidelines should be followed:

1)      All views using this lookup data in the result set should join to all of the data in the lookup table.  You do not want to filter out Archived items because you want to show this data for historic reasons

2)      Lists that are used within the application in order to select a new item from the above mentioned list (in this case Category) should only include items that are not Archived

3)      When the user is using the application and selecting a historic record to view, you want to display the lookup item as part of the record weather it is an Archived item or not

Now there is one more piece that is often overlooked and it usually leads to the following question: 

How do we display a historic item in a list, but not allow the user to select any other historic item other than the one that was originally there?

Easy, it’s all in the query.  When writing the code to get the list data to populate the list (combo box, list box, etc) pass in the “selected id” (in this case the selected CategoryID of 1 – for Assembly).  In this example, I’ll demonstrate how to do this in VB.NET code when using a dataset.

 
         Public Shared Function GetCategoryList(Optional ByVal iAdditionalCategoryIDToInclude As Integer = 0) As DataTable
            Dim cm As New SqlClient.SqlCommand
            Dim dt As New DataTable
            cm.CommandType = CommandType.Text
            If iAdditionalCategoryIDToInclude = 0 Then
                cm.CommandText = "Select CategoryID, Category from lutblCategory Where Archived=0 Order By Category"
            Else
                cm.CommandText = "Select CategoryID, Category from lutblCategory Where Archived=0 UNION Select CategoryID, Category from lutblCategory where CategoryID=" & iAdditionalCategoryIDToInclude
            End If
            modData.FillDataTable(cm, dt, ConnectionStrings.WeldQA)
            Return dt
        End Function

This can be implemented in a few ways including using a stored procedure, LINQ, or ORM Mapping tools.  I just wanted to show the code to demonstrate the type of change necessary in order to ensure that your lists will cleanly allow the preservation of historic data in the application.

It works by returning a sorted list of all non archived items in the case where we do not pass in a CategoryID to include.  In the case where we do pass in the CategoryID to include we first select all unarchived items from the database table and then union that to also select the additional item from the database table regardless if it is archived or not.  The union will also eliminate the possibility that the Category item will show up twice as unions by their nature ignore duplicate records.

For brevity, I won’t include the modData,FillDataTable code, but it’s basically a common routine we use to take a resultset from a command and fill a datatable. 

If you wanted to populate a list you would make a call such as the following:

1)      A fresh list where the user will select a Category for a new record

lstCategories.DataSource=GetCategoryList

2)      A record where the Category list item “Assembly” was already assigned before it became archived

lstCategories.DataSource=GetCategoryList(1)

This was a simple example of how to properly code your application and structure your database to effectively handle historical information used in list s across your applications.

Please let me know if you have any questions about the article or any suggestions on how I could improve this article.

 

Dan

 

Add Reusable (Inheritable) Commit/Rollback (Cancel Edit) Functionality To Your .NET Business Objects by Implementing IEditableObject

The IEditableObject interface in .NET is part of the System.Component model namespace and is used to provide functionality to your objects that implement this interface that allows the object to commit or roll back changes.  Typically your business objects will implement this interface in order for them to natively have the commit and rollback functionality you desire.  When using the business object as a data source that is bound to a control such as a grid control, the grid control recognizes the IEditableObject implementation and interfaces with it directly in order to achieve the desired commit/rollback functionality desired without having to write any other custom code in your UI layer or for the grid component.

We make heavy use of 3rd party components within our applications, and a big one that we use is the Infragistics WinGrid.  This provides excellent capability and works great with .NET datasets.  It also integrates well with business objects or lists of business objects as a data source, but unless your business object implements IEditableObject you will not get the native commit/rollback functionality you would get with a dataset.  For example – the user starts changing a record on a grid in a windows form and hits the Esc key twice to cancel their changes – this will not actually rollback these changes to the business object unless the business object contains logic to do so.

Like a lot of things when it comes to software development there are a few ways to accomplish this 1) A quick and dirty way that might work for the current business object, but requires a lot of customization for each additional business object that you want to introduce the functionality to 2) A thought out where we are really thinking about the architecture and that allows you to write the code once and re-use that same code where needed

Ok, so we have a base class that we created and we called it BusinessObjectBase and it implements IEditableObject.  The three methods of IEditableObject are pretty self describing – BeginEdit, CancelEdit, and EndEdit.

Here’s how we do it:

1) Created a MustInherit Class (Abstract in C#) – This is the class that all business object that we want to incorporate this functionality into will Inherit

2) Implement IEditableObject

3) Write code for each of the three methods that will give us this desired functionality. 

BeginEdit – Copies the current object (itself) into a new object of the same type.  This uses the MemberwiseClose method in order to create a copy of the current object to be used as the object we will revert to if the changes are cancelled.  This allows us to reuse this functionality as is without having to customize it for other object that have different property definitions.  We also set an internal boolean variable used as a flag to signify ‘edit mode’ to true.

CancelEdit – Uses reflection to copy the property values from the copied object that was created in the BeginEdit method.  It cycles through all of the public properties using reflection and copies those values back to the current object overwriting any changes made during the edit.  The MemberwiseClone method in this case could not be used because an object instance cannot set itself to reference another object from within itself.  Additional functionality was added to CancelEdit so that it would remove itself from the parent list that it was in if it was a new object.  This was put in place because grid components automatically add new objects to a list when adding a new object to the grid, so in this case if the edit is cancelled then we want to destroy the object as it never existed in the first place.  Please see related blog post Business Objects That Support a Parent/Child Relationship in .NET for information on how we implement the Parent/Child functionality that allows the child to reference its parent and provide the functionality needed here to remove new items from the parent list when they are cancelled.

EndEdit – Editing is complete and the changes are finalized, so we set the old version of the object that we created to backup the original data to nothing.  We also set the internal edit mode flag to false.

4) Create a new business object class (or use an existing one) and inherit BusinessObjectBase – you will now be able to use this class object in user interface components and retain commit/rollback functionality.

<serializable ()> _
Public MustInherit Class BusinessObjectBase
    Implements ComponentModel.IEditableObject
 
    Protected m_oOldVersion As BusinessObjectBase 
    Dim m_bInEditMode As Boolean
 
    ''' <summary>
    ''' The IList collection object that this object is part of.  If this object is not a child object in an IList object then Nothing is returned.
    ''' </summary>
    '<nonserialized ()> _
    Public ParentList As System.Collections.IList
 
    ''' <summary>
    ''' The parent object.  If this is a top level object then Nothing is returned.
    ''' </summary>
    Public Parent As BusinessObjectBase ' BusinessObjectBase
 
    ''' <summary>
    ''' Is the current instance of the business object a new instance that has not been committed to the database.
    ''' This is usually implemented by checking the value of an identifier property that would relate to a primary key in the database
    ''' </summary>
    Public MustOverride Function IsNew() As Boolean
 
    ''' <summary>
    ''' Method invoked by databound controls to signal that the object is going into edit mode (begin editing)
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub BeginEdit() Implements System.ComponentModel.IEditableObject.BeginEdit
        'store the old version of this object - so if we need to undo we will revert back to it
        If m_bInEditMode = False Then
            m_bInEditMode = True
            If m_oOldVersion Is Nothing Then 'this is only nothing when there are not pending changes to the object
                m_oOldVersion = Me.MemberwiseClone()
            End If
        End If
    End Sub
 
    ''' <summary>
    ''' Method invoked by databound controls to signal a cancel/rollback of the changes that have been made
    ''' to the object since editing began.  If editing an existing object then changes are rolled back.  
    ''' If editing a new object this new instance is removed from it's parent list.
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub CancelEdit() Implements System.ComponentModel.IEditableObject.CancelEdit
        Dim o As BusinessObjectBase
        o = Me
        If o.IsNew Then
            'this is a new object that hasn't been committed to the database
            o.ParentList.Remove(Me)
        Else
            'revert back to previous
            RevertObject()
        End If
        m_bInEditMode = False
    End Sub
 
    ''' <summary>
    ''' The property values of the current instance of this object are 
    ''' reverted back to their original values as of the BeginEdit method call.
    ''' Reflection is used to revert from the old version of the class to 
    ''' this instance by cycling through each property and setting the value
    ''' of this instances property equal to the value of the old version of the objects 
    ''' property value.
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub RevertObject()
        Dim t As Type = Me.GetType
        Dim p As Reflection.PropertyInfo
        For Each p In t.GetProperties()
            If p.CanWrite And p.CanRead Then
                'get original property value
                Dim oValue As Object = Nothing
                oValue = p.GetValue(m_oOldVersion, Nothing)
                'set value of this instance equal to original value 
                p.SetValue(Me, oValue, Nothing)
            End If
            'Next
        Next
    End Sub
 
    ''' <summary>
    ''' Editing of this object has been completed
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub EndEdit() Implements System.ComponentModel.IEditableObject.EndEdit
        m_bInEditMode = False
        m_oOldVersion = Nothing
    End Sub
 
End Class

Please see related article Business Objects That Support a Parent/Child Relationship in .NET for more information about creating the Parent/Child relationship between business objects and parent lists.

Please let me know if you have any questions and I’d be happy to address them. If you have any comments on how I could improve this type of article in the future plase let me know.

CIPS London Annual General Meeting 2009 Summary

I just want to write about tonight’s London CIPS event and Annual General Meeting.  The event took place at the InfoTech head office here in London, Ontario and began with Pizza and Pop followed by a presentation by David Canton on Website Legal Issues.  The CIPS Annual General Meeting followed, and among other things we nominated new board members followed by voting and announcing of the officers.  I’m pleased to announce my new position on the executive as Treasurer.  I’ll be taking over the role from Jonathan Korchuk who has been serving in that role for the last several years. 

I’m looking forward to my new responsibilities as Treasurer, and it fits nicely within the scope of my long term objectives.  Along with being a contributor and providing input at the executive meetings, as Treasurer, I will be responsible for the following:

“The Treasurer is the custodian of all the official property and records of the Section, and will deposit all the funds of the Section in a financial institution as approved by the Board. He will collect all monies, keep complete accounts, and arrange for payment of all approved indebtedness of the Section and keep proper vouchers for such payments. The Treasurer will issue, as required, notices to members whose annual dues are in arrears, and will submit an annual financial report, and any other financial reports as required by the Board. In addition, the Treasurer will submit an annual audited financial statement to the Board and to the National Office within six months following the Section’s Annual General Meeting.”

We have a total of four new CIPS Executive members tonight!  I believe we have a very strong executive team and I’m looking forward to a great year on the Executive.

Tim Hodges received a great appreciation at the event tonight for his work as CIPS London President for the last several years.  He’ll continue in this role again for this Executive year.  A job well done!

We’ll soon be updating the CIPS London website to reflect this new team which reminds me that I have to send in a short description/bio along with a picture to our webmasters so they can update the site.  http://local.cips.ca/london/executive.asp

 

CIPS London 2009/2010 Executive Team

Tim Hodges – President

Tony Curcio – Vice President

Jonathan Korchuk – CIPS Ontario Representitive

Margaret Kubasek-Vizniowski – Program Chair

Yotam Sichilima – Web Master

Abdalla EL Najjar – Student Services

Mathew Whitehead – At large, role to be determined (former role: Social Networking)

Dan Douglas – Treasurer

Carolyn Marshall– Communications Director

Mike Bondi – Social Networking

We’ve decided to also create a Communications Team which will consist of the Web Masters, Social Networking officer, and Communications Director.

IT Events Update

I’d like to throw some information out there regarding IT/Networking events, user group meetings, code camps, etc.  You can find like minded individuals at all of these types of developer events.  There is a large supportive IT community out there, and I would encourage anyone who is in this industry to check out some of these events.

Links to some of the types of events I’ve attended this year – most of these types of events should be available in a community near you – although I don’t know where you could be reading this from :)

Toronto Code Camp

This is an annual one-day free event held on a Saturday in Toronto. This year it was held on April 25, 2009.  There were several tracks that were mostly geared towards .NET development.  It’s a great turnout with hundreds of IT developer professionals in the industry and a great networking event.  Among other people, I met Mark Arteaga, owner of Red Bit Development, who I had the chance to discuss mobile device application development with the .NET compact framework. Mark is a Microsoft MVP, so I picked his brain about how the program works and the process to becoming an MVP.  Many major cities are also hosting annual code camps.

http://www.torontocodecamp.net/

Toronto SharePoint Code Camp

This is also an annual one day free event held on a Saturday in Toronto geared towards SharePoint.  This event really opened my eyes to how large the SharePoint community is.  SharePoint has really taken off and it seems that a lot of people are really jumping on the bandwagon.  As with the regular code camp, many major cities across North America are also hosting free annual SharePoint code camps.  A similar event is the SharePoint Saturday which is hosted in many cities including Toronto.

http://www.torontosharepointcamp.com

User Groups

User groups are a great way to get out there and support the developer community.  You have the opportunity to network with other developers, meet new people, and even present to the group.  There are many user groups available in many disciplines (including, VB.NET, SQL Server, Software Architecture, and Sharepoint).  They are a great way to introduce yourself to other members of the developer community.

I’ve personally attended the following user group meetings and have met some of the top people in our industry:    SharePoint user group (TSPUG), Visual Basic user group (TVBUG), and the Toronto IT Architecture user group.  The Toronto Visual Basic User Group was especially welcoming – the evening typically finishes off with drinks at a pub across the street.

All of these groups offer speaking or presenting opportunities for their members; I presented a presentation titled “The Basics of Software Architecture for the .NET Developer” at a coffee and code event for the London .NET user group last month.

iNeta provides support and resources to many user groups

Professional Developer Events

I’m planning on attending Tech Days 2009 in Toronto this year.  It has a great track and I’m looking forward to learning from the many speakers giving presentations at the event.  It also looks like it will be a great opportunity to network.

Business/ IT Networking

Almost every city has got these types of events.  Typically there is a presentation for the first half of the event followed by socializing and networking.  Very often these events are located at a bar or pub, so you can easily grab a beer or two if you like.  I’ve attended many of these types of events, and some have been useful and others haven’t.  It’s hit and miss, but still a great way to make contacts.

Meetup Groups

Almost every city has these too.  Basically, the purpose is just to get out to a bar or restaurant and mingle with other like minded individuals on topics such as Web 2.0, Web Design, Software, Podcasting, Blogging, or whatever… There are tons of these.  A good resource to see what’s available in your area is http://www.meetup.com

Professional IT Groups

You can become a member of CIPS or just attend their events for a slightly higher cost than non members.  I’ve attended many of these events including topics on SQL Server 2008, .NET Development, Cloud Computing, and events where vendors or developers show off the cool software or products they’ve developed.  I’ve been sitting in on the executive meetings.  Our next event is the Annual General Assembly being held on September 10th.  This is an annual meeting where we will nominate and elect new executive committee members followed by a regular CIPS professional event.

CIPS also regularly partners with Microsoft for many of their events such as the Heroes Happen {here} series of events.  I was asked my local CIPS chapter president to lead a discussion group at this event.  It was a great opportunity, and we had a great discussion (see here); I really liked this event structure.

Canada’s Association of Information Technology Professionals

If anyone has any recommendations for similar events please let me know by leaving a comment….

Dan

The Basics of Software Architecture for .NET Developers – Presentation

At our last CIPS executive meeting held on July 21, 2009.  We decided that it would be a good idea to create the first Coffee and Code event held jointly by the CIPS chapter of London (Ontario) and the new London .NET User Group.  We held the event last night (August 18, 2009 – on my birthday – not purposely). As part of this event I developed and presented a PowerPoint presentation titled The Basics of Software Architecture for .NET Developers.  The presentation touches on the basics of Software Architecture, along with ideas, tools, and resources that go along with software architecture for the .NET developer. 

Here is the link to the presentation.

https://dandouglas.files.wordpress.com/2009/08/coffee-and-code-presentation-software-architecture.pptx

 

I’d like to give a shout out to Tony Curcio, President of the London .NET User Group.  http://www.forestcityasp.net/  He’s done a great job of putting together this new .NET User Group in London.  Tim Hodges, is the CIPS London chapter president who also has done a great job in the past and present organizing local CIPS events.

Content on slides 2, 3, and 4 was taken from the Software Architecture presentation I worked on along with team members Adam DeMille and Matt Higgins for the Top Gun training program in 2008.

Understanding the Implicit Requirements of Software Architecture

I was reading an article today on the MSDN Architecture website titled Are We Engineers or Craftspeople? I found the following point very interesting:

Implicit requirements are those that engineers automatically include as a matter of professional duty. Most of these are requirements the engineer knows more about than their sponsor. For instance, the original Tacoma Narrows Bridge showed that winds are a problem for suspension bridges. The average politician is not expected to know about this, however. Civil engineers would never allow themselves to be in a position to say, after a new bridge has collapsed, “We knew wind would be a problem, but you didn’t ask us to deal with it in your requirements.”

This is a great analogy to implicit requirements within software architecture, and I believe that this idea separates the experienced senior software developers and software architects within the industry. 

In determining the architecture of a software system, it is the “duty” of the software architect to determine potential problems or risks with a design and mitigate or eliminate these risks.  The stakeholders of the project, don’t necessarily understand these risks nor do they necessarily understand their importance to the long term success of the project.

Let me describe four risks in software architecture and development that a Software Architect needs to implicitly understand and realize about the system they are designing.  When it comes to these potential risks, getting it right the first time should be a top priority in the architecture of the system.

Scaling

Recognizing the scalability requirements of an application are very important.  It is important to understand what the projected future usage, user growth, and data growth will be in the future.  A good rule of thumb is to then multiply this by a factor of 2 or 3 and develop the system based on that projected future growth.  It is important that your development environment be continually tested against this high usage and ensure that your development methods, strategy, tools, environment, and connected systems will effectively scale as well.

Also, regardless of the future requirements to scale, experience will demonstrate the type of development or tools to use that will scale well that do not necessarily have an impact on the development time or effort required.  These are approaches that should always be used, and they are a testament to the skill and experience of the developer or the individual leading the developers, such as the Software Architect.  An example of this would be in developing your database views or queries:  It is known, based on experience that there are good ways to develop these queries that will give the best performance out of the box versus other designs that may give the same results, but are slower, inefficient, and don’t scale well. 

By overlooking the importance of scalability, there is the potential for complete system breakdown when the usage of the system exceeds its capacity.  This will leave developers scrambling to spend additional time to fix the core scaling problems of the system, or force a potentially expensive purchase of beefier hardware (that otherwise should not be required) to support a badly scaling system.

Incompatibility

It is necessary to identify any points of incompatibility with the software system.  You have to look at all of the interfaces and interactions of the software system, human and systems,  currently and in the future.  This ranges from the users using the system to the other software and hardware components that interact with the system in a direct or indirect way.  It also includes future compatibility because it’s important to look at future requirements and ensure that the system is developed to meet those requirements.  To do this effectively, the Software Architect needs to have a broad understanding of a wide range of technology in order to make the right choices and also the business processes around the software system.  In essence, based on experience and skill, the Software Architect will pick the correct technology to support the current and future system compatibility of the application.

Failing to effectively perform this step could result in overlooking a critical system connection and cause additional development, resources, and funding to correct.  A system could leave some users in the dark and unable to access or use the system if they are using older or unsupported systems.  A good architecture would have accounted for this from the beginning to ensure all users (legacy and current) can use the system.  Another example could be a web application or intranet site that doesn’t work properly with a newer browser such as Internet Explorer 8.  Now, additional time and money would need to be spent in order to get it up to a standard that will work across multiple web browsers.  This could also impede a company wide initiative to upgrade all web browsers to Internet Explorer 8.

Future Maintenance and Enhancements

The future maintenance of a software system is incredibly important.   This idea should be instilled in your brain from the beginning of the software project.  Future maintenance and enhancements encompass everything that will make future updates, bug fixes, and new functionality easier.  A solid framework for your application is important, along with development/coding consistency, standards,  design patterns, reusability, modularity, and documentation.  It is important to understand these concepts, in order to fully benefit and utilize them to their full extent.  An experienced Senior Developer or Software Architect should have a full understanding of these concepts, why they are important, and how to implement them effectively. 

Overlooking this key factor could leave you with a working application, but code updates, fixes, enhancements, testing, and the learning curve required for new project members will be greatly diminished.

This step is sometimes what I call a “silent killer”, missing this step or lacking experience in this area may not be apparent to the end users or stakeholders of the software system at first, but it will have a huge drain on the ability to use, leverage, and maintain the application.

Some serious disadvantages I’ve seen first hand with this type of system are that users will report critical bugs that are difficult for the developers to track down and fix and developers become “mentally drained” and discouraged from doing any kind of maintenance or enhancements to the system.  Because of this and the fact that it will take many times longer to add new functionality to a poorly maintainable application, these types of systems evolve poorly and in a lot of cases end up being completely replaced by another system.  Think about the potential for unfortunate long term financial and business consequences when this step is overlooked! 

Usability

The software has to be useable.  You need to determine which functions are most common to the user and ensure they are easy to find and are the most prevalent features within the application.  Looking at a way to allow the user to customize the application goes a long way in order for individual users to customize the user interface so they get the most bang for their buck. 

The user interface, the technology behind the user interface (is it web? windows? java? or a combination of these technologies?), user customization, colors, contrast, and user functionality are important.  I also believe that a user interface has to look somewhat attractiveThe application itself should be useable and self describing without requiring the user to read a manual or documentation.  You’ll find that you will have more enthusiastic users and less technical or service desk support calls when the application is easy to use and performs the functions that the user needs to perform.  It should make the job of the user easier!  Simple things in your application such as toolbars, context sensitive menus, tabbed navigation, and even copy/paste functionality should not be overlooked.  User interface standards also need to be followed, as you do not want the user to be confused if the basic operation of the application differs substantially from the applications that they are used to. 

Basically, if users or customers do not want to use the software or application because it is too difficult or cumbersome, you end up with the users not actually using it and going back to the old way of doing things, or being forced by “the powers that be” to use it against their own objections about its usability.  Neither of these situations are ideal and they result in lost productivity or the inability to have future potential productivity gains come to fruition.

 

Conclusion

A failure to identify and mitigate or eliminate these issues could mean a failure or breakdown of the system.  This costs large amounts of money and time to do an “after the fact” correction that’s required, or in a worse case – completely wasted money on a failed implementation that ended up getting axed all together.  I’ve witnessed first hand accounts of both of these scenarios and they are not pleasurable for anyone involved.  As part of eliminating wasteful time and money we need to make sure that we do software right; gaining the right experience, skill, and paying attention to and understanding the implicit requirements expected of a Software Architect, we’ll have high functioning software that will serve its current and future requirements well, and provide a continual and exceptional value and return on investment.

In addition to the points above and though not touched on in this posting, I haven’t forgotten about Buy-In, Security, Availability, Having Proper Business Processes In Place, The Role of The Business Analyst, Communication, Team Leadership, etc.  These points are also very important in order to have a solid foundation for a software project.  I’ll definitely talk about these items in a future blog posting.

Thanks for reading!  I welcome any comments (positive or constructive).

Dan