Jan 30, 2009

Time for a Refresh

You may have noticed that I’ve done a bit of a visual refresh on the blog.  The old theme was getting a little long in the tooth, so I went hunting and found a new template to run with (details in the footer).  I think this one looks much better than the old and it only required a little hacking and slashing to get it into the shape I wanted.

For those who only see this blog via RSS you obviously won’t have noticed the change, so feel free to click on through and see what the new site looks like.

There’s been one other change as well.  Blogger introduced a “new” feature a while ago where the comment form can be embedded in a post so that you don’t need to use that annoying comment form.  Yes, they were about 3 years behind everyone else, but at least they got there.  You should now see a comment entry box at the end of each post where you can add your thoughts and 2-cents worth.  So why don’t you give the new comment thing a go and tell me what you think of the new look and feel.

Jan 28, 2009

Book Review: Using MSBuild and Team Foundation Build

I’ve just finished having a read through of “Inside the Microsoft Build Engine: Using MSBuild and Team Foundation Build” from MSPress.  I was kind of wondering if there’d be any book left by the time I finished reading the title!

Thankfully there was.  The book is broken into two main sections – the first dealing with MSBuild and then the second on how MSBuild works in a TFS environment and some of the extra things you can do in TeamBuild.

As far as content there’s not a lot of preamble and the book jumps straight into MSBuild features which makes the introductory section a little hard to get your head around if you’re not someone who has dealt with MSBuild before.  I think a short initial section explaining the way MSBuild processes scripts and how it works at a high level would have been a useful precursor to the rest of the book.  But regardless, you can still get up to speed on it quickly, as long as you make sure you take the time to grok what’s explained in the quick start chapter.

After that you get into the meatier stuff.  One of the things I was hoping not to see was an exposé of all the various out of the box tasks that you get with MSBuild as it would have just make the book a reference tome and pretty much worthless as far as I’m concerned.  I’m glad to say this doesn’t happen and instead the book focuses more on the practicalities of build scripts and making sure you understand how to do useful stuff.

It also spends a fair amount of time explaining how the MSBuild scripts work.  MSBuild is pretty damn ugly as far as its syntax is concerned since it’s all XML and requires the liberal use of %’s , @’s and –>’s to signify behaviour. Its very unintuitive and turns off a lot of people right from the start so having a book that explains it (and a lot better than the MSDN docs do) really helps.

The book runs through all of the functionality of MSBuild, including things like developing custom MSBuild tasks and loggers, and in particular has some very useful information on adding batching and incremental builds to your build scripts.  This is one of the least understood areas of MSBuild (probably because the syntax sucks) and to see it well laid out and explained in detail was quite good.

As I mentioned the book tries to be practical with its content and contains cookbook sections to help you with common tasks such as

  • setting assembly versions,
  • starting and stopping services,
  • transferring files via ftp,
  • compressing JavaScript, and
  • encrypting web.config files

It also has useful examples on integrating NUnit & FxCop into your build scripts.

 

The book then moves on to Team Build, with an obvious focus on TFS2008, though it does provide tips on what you could do if you are still using TFS2005.  For example TFS2008 introduced retention policies on builds.  Previously you either had to delete builds manually to stop the disk filling up or automate the cleanup it with an external tool – the book even gives Mitch a plug for the TFS Build Clean up utility he wrote).

As you’d expect the book goes through the details of how Team Build works, explains the different build types and how to customise the process as well as providing another cookbook section so you can get an idea of how to do things such as:

  • generating documentation using sandcastle,
  • load balancing builds across multiple build servers, and
  • adding extra details to the TeamBuild log in Visual Studio

Probably the only thing I was a little disappointed in was the lack of a section on automating deployments after a build completes.  Tools like TFSDeployer can really help streamline the deployment process from TFS and it would have been great to see a few pages devoted to this subject.  I guess you can’t have everything!

 

Summary: A useful reference and guide for both MSBuild and TeamBuild.  It’ll save you hours of digging through and trying to understand the technically correct and practically useless MSDN docs to decipher how to do what you want to do.  The cookbook sections in particular and the practical focus throughout are great and I think it would make a good bookshelf addition for anyone who needs to manage build scripts in a TeamBuild or MSBuild based environment.

Score: 8/10

 

Full disclosure: I obtained this book for free with the intent of doing a review.  I tried not to let the fact that it was a freebie affect my review of the book.

Jan 16, 2009

Decoupling Your Code, By Example

Let’s just say, for arguments sake, that you’ve run across a piece of code that is tightly coupled, i.e. there are lots of hard links between classes, it’s hard to test, changes are difficult, the code breaks when it shouldn’t, etc.  Let’s also say, for arguments sake, that you want to improve the design of that code and make it somewhat more maintainable so that you don’t spend the rest of your natural life trying to keep the code from completely falling apart.

How would you do that?

In this screen cast I’ll walk through a sample application, show where the tight coupling occurs and how to remove it.  In the process I’ll also be cover a bit of unit testing vs integration testing, mock frameworks, and inversion of control containers (Unity in this case).

Hopefully you get some value from it.

Download the WMV (93Mb, 44mins)

Double click for full screen

References:

For those interested in the Visual Studio add-ons they saw, I am using:

Finally, the video is hosted at http://silverlight.live.com.

Jan 14, 2009

Virtual Alt.Net Meeting – 15-Jan

Zach has kindly volunteered me to host the Virtual Alt.Net meeting this week while Chad is away, so if you’ve got anything you’d like to see discussed then get in touch or just join the meeting and call it out once we’re going.

The LiveMeeting URL is http://snipr.com/9wurv and it gets underway at 2pm Sydney time.

See you there!

The Australian Alt.Net Community is Alive

The URL for the Sydney Alt.Net group has just changed.  It’s now http://sydney.ozalt.net (the old address will redirect). This is because we now have an Australian Alt.Net community at http://ozalt.net with new groups starting in Brisbane and Perth over the next month or so and it’s about time the Aussie’s had an Alt.Net presence of their own.

There’s also a mailing list just for the Aussies, so if you find the fire hose that is the main alt.net mailing list to daunting, feel free to converse and ask questions in quieter channels with people in your same time zone.

The community is still growing and it’s your community, so feel free to get as involved as you like and help shape the future.

Jan 12, 2009

Some Thoughts on Object Databases

I spent a decent amount of time working with PostgreSQL some years ago and thought at the time that the concept of databases that could store objects was fantastic.  None of that object relational impedance mismatch hoo-hah – just save an object, retrieve an object, etc.  Unfortunately reality wasn’t so great - the tooling around reporting and support by other applications was lacking, and that plus various other influences at the time meant I didn’t really get to explore it much further and it eventually dropped off my radar.

This morning I listened to the Alt.Net podcast where Rob Conery is talkng about Object Databases (or post-relational databases as they’re sometimes called).  It’s an interesting podcast and well worth the 30 minutes you’ll need to listen to the whole thing, and it was great to hear that Rob’s sentiments reflected most of mine, though I’m sure he expressed them in a lots gooder way.

It sparked me to have a quick look at where things are at these days in the ODBMS world and to see if the critiques the SQL fans have of them are still valid.  So let me present a very paraphrased version of the wikipedia entry on the Pro’s and Con’s of ODBMS’s

Pros:

  • Performance for certain operations smashes relational databases (mainly around CRUD operations)
  • You can still add indexes for object properties to improve performance
  • Some ODBMS tools now feature SQL language support
  • No need to do object to database mapping

Cons:

  • General queries can be slower (i.e. selecting data by an entities property values)
  • Interoperability
  • May require a change in design philosophy.  Need to stop being data centric and start being domain centric in your application design.

OK, so speed can be an issue as well as interoperability.  It’s the second one that is the biggest barrier to adoption and is after all the main reason I didn’t do more with it in the past – however Rob made a comment on the podcast that really stuck; why not run both an ODBMS and and RDBMS side by side?  The two types of database engines really serve different purposes, and people already run multiple databases today with different purposes – e.g. transactional vs reporting databases – so why not do the same with ODBMS and RDBMS engines?

Here’s what the ODBMS.org web site has to say on this idea:

“Thus object databases are increasingly established as a complement to (not a replacement for) relational databases for efficient resolution of the OR mismatch. ODBMSs are flourishing as embeddable persistence solutions in devices, on clients, in packaged software, in real-time control systems, and to power websites.”

Interesting stuff and it certainly gets the mind thinking of possibilities.  I think it might be time to have a revisit of the whole ODBMS scene and see where things are at now.  I’ll probably start with the db4o database engine as it’s an open source native .NET engine with a strong developer community, it supports linq for querying (codeproject sample) and weighs in at a very light 13.5 MB.  That’s good enough for me :-)

Jan 8, 2009

The Aussie Scrum Survey

James & Martin are running a survey trying to get a feel for how Scrum is being dong within Australia.

The more responses the better, so head on over and give it a run through.  It’ll take you all of 5 minutes, if that.

The Rise and Fall of Waterfall Development

The Waterfall Development model is something we all know and loathe.  Thankfully in recent years we’re seeing the industry slowly turning away from this model and moving back to the iterative development models used in the 1950’s, before the rise of waterfall.   What’s ironic about waterfall development is that it’s creator (Winston Royce) never actually intended it to be a model for software development!

Royce says this in the paper where the model is shown: “I believe in this concept, but the implementation described above is risky and invites failure” and he explicitly mentions that changes can cause anything up to a 100% overrun since it may involve going right back to the drawing board.  He then goes on to evolve that model and introduce safeguards to minimise the risks of change.

So how did this initial model turn into the “One True Way” of software development?

First consider that Royce’s paper was published in an IEEE publication – IEEE is a well respected industry body and anything they publish is going to immediately have substantial respect.  But now consider the background of the author.  To quote again: “I have had various assignments during the past nine years, mostly concerned with the development of software packages for spacecraft mission planning, commanding and post-flight analysis.”  He was working at NASA in the hey-day of the space industry!  The whole world was looking at everything these guys did and reading it as gospel!  After all, these were the people who managed to put man on the moon and bring him back again using nothing more than a tin can, some electronics, a couple of goldfish bowls sewn into to some silver jumpsuits and one freakin’ great big rocket!  Of course people were going to listen to what he said!

Tarmo Toikannen said this about what happened next:

If you look at the scientific articles on software engineering that discuss the waterfall, they all cite Royce’s article. In other words, they’re saying something like “The waterfall is a proven method (Royce, 1970).” So they base their claims on an article that actually says the opposite: that the model does not work.

This is how science (unfortunately) often works - researchers just cite something, because everyone else does so as well, and don’t really read the publications that they refer to. So eventually an often cited claim becomes “fact”.

But why did so many people reference the broken model?  You might laugh at this, but it’s probably because the model shown was the first diagram in the article.  Instead of looking at the other diagrams to see how the broken model is then evolved into the model that Royce finally proposes they just copied the first image they saw and went from there.

mmmOkay.  But that still doesn’t explain everything.  Why did a model that those in the real world knew didn’t work gain so much traction?  Well, you can thank the US Military for that one – in fact you can specifically thank the geniuses who wrote DOD Standard 2167 – a standard which was not only waterfall based but also heavily documentation focussed.  As soon as the military decided all software should be written to that standard, it became the de-facto for all other large scale development.  You can imaging the thinking “If it’s what the military uses to get high quality software then shouldn’t we do the same?”.  The problem was further compounded when other countries followed the Don’t Reinvent The Wheel principle and adopted the existing US standard for themselves.  Now it was a global standard.

Thankfully the US Military amended their standard in 1995 and multiple times thereafter but by then the damage had been done.  Waterfall was the only thing being taught by academia and the industry was too earning much money by doing things poorly to quickly change to something that made sense.

Only now are we seeing a strong resurgence of the working, iterative, incremental development model of the 1950’s – and it’s got a name now: Agile.

 

P.S. If you want to read something a little more in-depth on this subject have a read of Iterative and Incremental Development: A Brief History (2003).

 

References:

http://www.cs.umd.edu/class/spring2003/cmsc838p/Process/waterfall.pdf

http://tarmo.fi/blog/2005/09/09/dont-draw-diagrams-of-wrong-practices-or-why-people-still-believe-in-the-waterfall-model/

http://www2.umassd.edu/SWPI/xp/articles/r6047.pdf

http://en.wikipedia.org/wiki/Waterfall_model

http://www.product-lifecycle-management.com/download/DOD-STD-2167A.pdf

http://www.stsc.hill.af.mil/crosstalk/1995/04/Changes.asp

Jan 6, 2009

A More Structured Approach to Exceptions

Exception management.  Ah, the two words that can so easily send shivers up the backs of many developers.  And they are what they are, right?  Wrap things in a try/catch and go from there.

Well, Michael Feathers has just posted a blog entry on a slightly different approach to exceptions for those times where you want to be able to call a function and then handle any exceptions in a more structured way than just doing some inline processing (or swallowing them whole!).

Go have a look, it’s an interesting and simple approach and you could easily convert it to an extension method if you wanted to make your code just that little bit more intuitive.