Nick Parker
My ramblings on .NET...

Mingle

Tuesday, 20 March 2007 20:58 by nickp

This definitely sounds promising; I'm going to keep my eye on it.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Agile
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Must Read

Tuesday, 9 January 2007 14:11 by nickp
Jeremy Miller has an excellent read on writing orthogonal code. Do not pass go, do not collect $200 until you have read this post. If you have even more time (read: an hour at a minimum) I highly recommend reading Big Ball of Mud which dissolves the forces behind what cause software architectures to fail and discusses solutions to address them. Finally, Jason Yip hit the nail on the head when discusses what it takes for last minute changes to be safe. Several years ago I worked on a team that produced a calculation engine for life insurance policies. Our team had a process defined for implementing last minute change requests that required the approval of our IT director, and several times I saw those requests denied. While we did have support for many of the points Jason identifies, quality should not be sacrificed over a delivery schedule. DHH covers this in Chapter 5 of Getting Real - Build half a product, not a half-ass product. Thoughts?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Agile | Software
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

HDC Presentation

Thursday, 26 October 2006 20:39 by nickp
Tim and I just finished out presentation on Model View Presenter in ASP.NET 2.0 this afternoon which we followed up by doing a podcast for PodcastStudio.net with Jeff Julian and Dru Sellers. Overall I was very pleased with the presentation, we had one issue with a live demo, but since when do demos work in front of 150 people? For anyone interested, the code is available on svn here.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   .NET | Agile | Software
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Heartland Developers Conference

Tuesday, 17 October 2006 00:39 by nickp
The 3rd annual Heartland Developers Conference will be October 26th and 27th in Omaha, NE. HDC has just sold out with over 500 attendees expected! Tim Gifford and I will be presenting on the Model View Presenter pattern within ASP.NET 2.0. It appears that Kent Tegels is presenting at the same time. He is covering the new Entity Data Framework which sounds intriguing. For those that are curious, we will be using NHibernate for our data persistence tool during the presentation. :-) Let me know if you'll be out there the night before for the party.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Mock Object Discussion

Thursday, 14 September 2006 13:03 by nickp
Scott Hanselman has a great discussion on mock objects on Hanselminutes. They go over the basics of how mocks fit into the development environement and how it helps in a test driven development environment. Scott mentions how the Expect API of many mock object frameworks read like an english sentence, this is a great example of a fluent interface. Scott points out one of the most apparent reasons why Rhino Mocks is a great mock library, it doesn't rely on string-based method names, you actually use the method in your expectations. This is great because it allows developers to lean on the compiler, this can be especially useful as you refactor your code base

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   .NET | Agile | Software | TDD
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

A Good Feeling

Tuesday, 8 August 2006 13:00 by nickp
Our team adopted a continuous integration server a little over a month ago and we have been very happy with the results since. We were using Visual Source Safe as our source repository and CC.NET for a continuous integration server. A special "builder" account was created in VSS for CC.NET to pull down the source for each project it had registered. Our projects are set to trigger within CC.NET every 15 minutes. Over time, as we added more projects, CC.NET would report a failed build sporadically. The build error alluded to a VSS user specific log file that was inaccessible during the period of time CC.NET would try to access the repository. This file was locked during a parallel/previous build by VSS - this is a known issue and has been discussed on the CC.NET forums. All-the-while, we continued to have various issues with VSS that would cause us to reboot the repository server from time to time - totally unacceptable in my eyes. It was time for a better source control system to step up to bat, welcome Subversion to the team. I have been using Subversion for a while for personal projects, but as of Friday last week we have migrated our repository from VSS and our entire team is now using Subversion. Our CC.NET is running much smoother now, in fact we haven't had any issues as of yet. We are using AnkhSVN for Visual Studio integration and TortoiseSVN for integration within the Windows shell. I can gladly say goodbye to pessimistic locking for good now.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   .NET | Agile | CI
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Bored During Build Time?

Tuesday, 25 July 2006 17:27 by nickp
It's very important to keep your build time as short as possible, but everyone has to deal with it one way or another. If you enjoy anagrams, try waitingforbuild.com next time you are waiting for your build process to complete. On a serious note, if your build time is extremely long (can you eat lunch during your build?) then the next step is to shorten your build time to increase the feedback loop within your development team. The longer your feedback loop is among the development team, the longer it will take to fix bugs when they are identified. A common area where this occurs is where integration tests are used within the smoke test suite. By the nature of integration tests, they tend to take much longer than simple unit tests. Integration tests require outside resources such as a network or database, all which take time to run - assuming they are all available during the run. Remember, if your unit test requires a network resource, file or database connection, it is not truely a unit test. There is nothing wrong with having these types of tests available to be run, however using those within a smoke testing suite can produce inconsistent results that may be misleading. Thoughts?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Agile | CI | Software | TDD
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Asynchronous File I/O with NAnt

Thursday, 25 May 2006 11:43 by nickp
I recently needed to recursively iterate over a directory and change the content of files based on a search term. While there are certain NAnt tasks that have been defined to perform similar operations such as the foreach task used in conjunction with a loadfile and its associated filterchain and replacestring, I didn't see an easy way to recursively navigate the directory and perform my changes. A potential solution might have been nesting several foreach tasks and assigned the child directories to a property and subsequently call a different task to pull that directory out of the property, it didn't seem very natural or safe (could the property change before the second NAnt task requests it's value?). To my knowledge there is no locking mechanism in NAnt for properties. I'm interested if anyone has tackled this issue before directly within NAnt. Because custom NAnt tasks are easy to write, here is what I came up with. Initially I was performing the reading and writing of the file synchronously but the performance was horrible, a simple rewrite of that portion allowed me to perform asynchronous file I/O and my performance bottleneck disappeared. The follow code below allows me to define my task in NAnt as follows:

 

<recurse directory="${ProjectPath\src\${ProjectName}.Web" lookfor="SomeWord" replacewith="${ProjectName}" />

 

 

namespace developernotes.tasks
{
using System;
using
System.IO;
using
System.Text;
using
NAnt.Core.Util;
using
NAnt.Core.Attributes;
using
System.Text.RegularExpressions;

[TaskName("recurse")]
public class RecurseTask : NAnt.Core.Task
{
public RecurseTask(){}

[TaskAttribute(
"directory", Required=true)]
public string Directory
{
get{return directory;}
set{directory = value;}
}
private string directory = string.Empty;

[TaskAttribute("lookfor", Required=true)]
public string LookFor
{
get{return lookfor;}
set{lookfor = value;}
}
private string lookfor = string.Empty;

[TaskAttribute("replacewith", Required=true)]
public string ReplaceWith
{
get{return replacewith;}
set{replacewith = value;}
}
private string replacewith = string.Empty;

[TaskAttribute("pattern")]
public string Pattern
{
get{return pattern;}
set{pattern = value;}
}
private string pattern = "*.*";

private void
WalkDirectory(DirectoryInfo di)
{
if(di != null)
{
FileInfo[] fia
= di.GetFiles(this.Pattern);
if
(fia != null)
{
foreach(FileInfo fi in fia)
{
ReplaceFileContent(fi.FullName)
;
}
}

foreach(DirectoryInfo d in di.GetDirectories("*.*"))
{
WalkDirectory(d)
;
}
}
}

protected override void ExecuteTask()
{
DirectoryInfo di
= new DirectoryInfo(this.Directory);
WalkDirectory(di);
}

public class FileState
{
public byte[] Data;
public string
FileName;
public
FileStream FileStream;
}

private void ReplaceFileContent(string file)
{
FileStream fileStream
= new FileStream(file, FileMode.Open);
FileState state = new FileState();
state.FileStream = fileStream;
state.FileName = file;
state.Data = new byte[fileStream.Length];
fileStream.BeginRead(state.Data, 0,
(
int)fileStream.Length,
new AsyncCallback(ReadDone), state);
}

private void ReadDone(IAsyncResult result)
{
FileState state
= result.AsyncState as FileState;
Stream stream = state.FileStream;
int
bytesRead = stream.EndRead(result);
stream.Close();
if
(bytesRead != state.Data.Length)
{
throw new ApplicationException("Invalid read:"
+ state.FileName);
}
string content = ASCIIEncoding.ASCII.GetString(state.Data);
string
update = Regex.Replace(content, this.LookFor,
this.ReplaceWith, RegexOptions.IgnoreCase);
WriteContent(state.FileName, update);
}

private void WriteContent(string file, string content)
{
FileStream fileStream
= new FileStream(file,
FileMode.Truncate)
;
FileState state = new FileState();
state.FileStream = fileStream;
byte
[] data = ASCIIEncoding.ASCII.GetBytes(content);
fileStream.BeginWrite(data, 0, data.Length,
new AsyncCallback(WriteDone), state);
}

private void WriteDone(IAsyncResult result)
{
FileState state
= (FileState)result.AsyncState;
Stream stream = state.FileStream;
stream.EndWrite(result);
stream.Close();
}
}
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Open Source | .NET | Agile
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Ruby on Rails and .NET

Wednesday, 5 April 2006 00:01 by nickp

There has been a lot of hype out in the development community over the past year regarding Ruby on Rails, even with Ruby alone. For those that are unaware, Ruby on Rails is a full stack web framework written in Ruby. While I've only read the first 100 pages of Agile Web Development with Rails, I can say that RoR is very intriguing. At a high level, RoR relies on a MVC architecture, using the ActiveRecord design pattern for data persistence. I've found radrails to be an excellent IDE for RoR if you're developing on a Windows machine. If you find that you really enjoy Ruby, but work in .NET, I'd suggest looking into RubyCLR created by John Lam.

Back to .NET, the Castle Project, where DynamicProxy lives (this is used in Rhino Mock to intercept mock interface calls); is also host to several other interesting projects relative to the .NET world. MonoRail is an attempt to provide much of the functionality seen in RoR within the .NET environment. I can't help but wonder if we will see something come from Microsoft in an attempt to fill this space with a commercial product similar to how they have provided a testing framework in VSTS and their ATLAS implementation that is soon to be released all of which were rooted in open source products.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Open Source | .NET | Agile
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

ROI for Agile Methodologies

Wednesday, 1 March 2006 23:12 by nickp
A common question I have heard regarding the use of agile methodologies is how can I determine the ROI of our new found practices. ThoughtWorks, an IT consulting company heavily involved with the agile movement has commissioned Forrester Research to perform an assessment of their processes; here you can read about their results.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Agile | Software | TDD
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed