Sunday, September 3, 2006

Dear SourceSafe, I've found another

Dear SourceSafe,

We've been together so long and during that time we've been comfortable together, but not safe. During our time together, I've learned about your quirks. I admit then we first got together, I made some mistakes. I can't blame you for everything. But as we spent more time together, I discovered things about you that were harder to overlook. You don't have atomic check-in, you exclusively locked files, and it takes you forever to check-in, check-out, and create history reports. Through all this, I stuck with you.

Our relationship has gotten so bad that when you're not around, my friends and I make jokes about you. We use hurtful names for you like "Source Unsafe" or "Sour Safe". This isn't fair to you and I feel awful about it, because I know how insecure you are.

I have to be honest with you, I've been thinking about someone else, Subversion (SVN). Subversion is different from you and that's a little scary, a little exciting, but from the little amount of time that we've spent together...it just feels right. You know what I mean? I'm sorry, but never got that feeling with you.

I know we'll continue to run into each other for years to come and I'd like to remain friends, but I think it's best if we spent some time apart for awhile.

Sincerely,
Tim

P.S. If your interested in learning more about Subversion and how to install it on a Windows system. Please refer to these links.

If you're planning on using Apache Web Server, the SVN module doesn't work with the latest version (2.2.x). Use version 2.0.54 (at the time of this writting).

http://geekswithblogs.net/emanish/archive/2006/06/14/81905.aspx
http://blog.briankohrs.com/2005/09/20/guide-to-installing-the-subverison-http-module-on-windows/
http://www.subversionary.org/howto/setting-up-a-server-on-windows

Sunday, August 27, 2006

Object-Oriented Overview and Shared vs Instance Methods

In order to be a quality software developer today, you need to have an understanding of object oriented programming. However, if you want to be an Agile or Test Driven developer, you need a much stronger understanding. Why? Because when you're agile, you must be able to make changes quickly without affecting the system. In order to do that, you need to reduce (or eliminate) duplicate code and minimize coupling. OOP provides ways to do these things better than (in my opinion) procedural programming.
 
The purpose of this post is to provide a quick start to OOP. I hope you find it helpful.
 
Object-Oriented Overview
I found a simple and short tutorial to OOP concepts. It's in Java, but the concepts work for any OO language and it's short and simple.
 
 
So do you know the difference between a class (or Type) and an object?
 
A Class is the code that defines an object. An object is an instance of that class. If you "new up" a class, you get an object. It's that simple!
 
Shared/static vs. Instance Methods
Now that you understand the differences between a class and an object we can discuss the difference between Shared and Instance methods. Shared methods are at the class level, instance methods are on the object..err...instance. This means that each object that is created has it's own copy of the instance methods, but the shared function is used by all code in the application. I guess that is why the VB.NET team named them "shared".  Since shared methods are global, they can be helpful in some situations, for example, factory methods or singletons, but in general I avoid them for a few reasons:
 
You can't put shared methods on interfaces
Shared methods can cause multi-threading problems
They encourage procedural coding
 
Example:
For this example we'll use the good ol' Person Class.
 
        Public Class Person
    'Constructor
    Public Sub New(ByVal firstName As String, ByVal lastName As String)
        Me.FirstName = firstName
        Me.LastName = lastName
    End Sub
 
    'Fields
    Public FirstName As String
    Public LastName As String
 
    'Instance Method
    Public Function DisplayName() As String
        Return String.Format("{0}, {1}", Me.LastName, Me.FirstName)
    End Function
 
    'Shared Functions
    Public Shared Function Steve() As Person
        Return New Person("Steve", "Person")
    End Function
 
    Public Shared Function Tim() As Person
        Return New Person("Tim", "Person")
    End Function
 
End Class
In the Person class, FirstName and LastName fields are data stored within an object, and the DisplayName function describes a behavior for the class.
 
An object is an instance of a class. When "new up" a class we create a new instance (object) of the class. In this example, myPerson is an object, Person is a Class.

    Private myPerson As Person = New Person
 
To access a shared method, you don't need to "new up" an object. You can call it directly on the class. For example, Person.Steve() or Person.Tim(), work without "newing up" an object.
 
However, we don't have access to instance (non-shared) methods. You can't call Person.DisplayName(), but you can "new up" a person object and call DisplayName(), New Person().DisplayName.
 
In order to add to the confusion, VB.NET shows Shared methods on object variables. Calling myPerson.Steve() on an object instance works fine in VB.NET, but causes confusion. Please don't do this. I was hoping the VB.NET team would remove this "feature" in 2005, but it would have broken alot of systems.
 
I hope this wasn't too confusing, but understanding the basic concepts will help you develop better quality systems.
 

 

Monday, June 19, 2006

IIS looses changes after restart

Mike Phelps sent this tip around to our team a couple weeks ago. I've experienced this problem and never put all the pieces before. Not it makes perfect sense. Now if I coule get him to start his own blog ;)

IIS runs strictly from memory (i.e, the IIS metabase is loaded to RAM). If you make changes to IIS, they are only made in memory. The changes don't actually stick until IIS writes to disk. This can occur with safely shutting down windows, or restarting IIS without a timeout/clicking End Now.

Want to see for yourself?

  • 1) Go to properties of the DataPortal web site, and change the anonymous credentials to be your user.
    2) Close the IIS control panel.
    3) Start/Run iisreset /timeout:0

    • A)This forces IIS to shut down, without saving to disk. The wait time is used to persist to disk.

    4) Check the user you changed in #1. It will be back to the original user.

The point: Be wary of using the timeout option when you've made metabase changes.

Saturday, May 20, 2006

Agile Pep Talk

I had the opportunity to spend lunch with Matt Ring last week. He contacted me via my blog (Someone reads it!). He needed an "agile pep talk". He's on the right track and hopefully I gave him a couple practical tips he could use as soon as he got back to the office.

If you need an "agile pep talk" or have some general questions on how to implement agile practices on your projects, feel free to contact me and we can grab some lunch and chat. Or for those of you don't eat, you can find me at every Agile Iowa and Iowa .NET User Group meeting.

Thursday, May 18, 2006

Tracking Manual Tests with FitNesse

Our team has been working with FitNesse for a couple months and I believe we are getting over the learning "hump". A question came up today and I think we came up with a good solution and I wanted to share it with others who may be in transition period with FitNesse.

We aren't able to create FitNesse tests for all the functionality within the system so we do have some manual tests we need to verify are working. We need to track the manual tests within FitNesse so naturally we created a fixture!

Our "manual test" fixture contains 2 columns: Description and Passed. Description contains the manual test case and Passed contains the DATE the test passed. Entering the date allows us to track the last time the test passed. The fixture also takes a parameter for the number of days between manual tests.

!|Run Manual Tests Every|90|Days|
|Description|Passed|
|Do some manual test|5/18/2006|

When the fixture runs, it checks if the manual tests have passed within the configured time period. If not it will throw an error and provide visibly to aging manual test results.

Manual tests are not the ideal solution, however, by tracking the manual tests and their age we can provide a stop gap solution while teams are working to automate their user acceptance tests. It also gets the non-technical team members familiar with FitNesse syntax and hopefully prepare them to speak in the language of "FitNesse".

Have you or your team created a custom fixture to solve a problem? Please leave a comment and let me know.

NOTE: My blog is junk! If the human interface proof image doesn't show up, remove "#feedback" from the URL.

 

Sunday, April 2, 2006

Rocky's comments on Test Driven Development

There is fued of sorts between the TDD crowd and Rocky Lhotka. I guess someone forgot to warn Rocky about the TDD crowd. This is the same community that got Microsoft to remove an article about TDD and VS 2005 that was on MDSN...briefly.

Rocky made some comments during a recent episode of DotNetRocks and Jeffery Palermo had some comments to which Rocky responded.

This is very interesting to me because we are using Rocky's .NET Business framework and trying to apply TDD practices with limited success. I would post about them, but I'm afraid I'll get flamed by the TDD crew (kidding, will kinda).

Saturday, March 25, 2006

Great .NET Rocks Episodes

I just spent most of today working on my Microsoft SBA Add-in and listening/watching the latest couple episodes of .NET Rocks TV.

In these episodes Jean-Paul Boodhoo explains the Model-view-presenter (MVP) patterns, demonstrates NMock v2 framework, and builds a simple application using Test Driven Development/Design process. He does a great job explaining these concepts while developing a simple web form application. This is well worth your time if you have a couple hours to spare.