General


Integration - Is It Worth It?

One thing I get asked to do a lot is integrate systems with each other or incorporate other systems into one we are currently building. In a lot of scenarios I have been starting to give some pushback on this. Sure integration is cool and all but should it be done? Expense The first (and ongoing) issue is the expense of integrating systems. First you have to understand the systems (or at least the APIs being exposed) of each system which can take a lot of time. Secondly we have to write code to integrate the services and adapt concepts from one...

Learn From My Mistakes?

One of my frustrations with Silverlight has been that the async model is rammed down your throat. I understand the reasoning that it is good to have the UI thread responsive while long running calls are happening. But to me that is something that I code and I control. The thing that gets me is that there are times where several network operations may have to happen in sequence. Here is a simple contrived example: var service = new VehicleRentalService(); if (service.AreVehiclesAvailableToRent())   {   txtNumberOfCars.Text = service.GetNumberOfCarsForRent();   if (service.IsTheFlakyOnlineRentalServiceRunning())       {        btnBookOnline.Enabled = true;       }   } Now for the above example I would run all...

MVVM and Designer Data

Over the last week I have been playing around with Silverlight and the Model View View Model (MVVM) pattern that I have heard such great things about. So far it is a really nice way to separate the UI logic from the UI and make it easily testable. One of the things I loved in Silverlight was the support for design time data. Design time data allowed you to specify dummy data that would appear in VS/Blend so that you could work with the UI with sample data. This saves so much time as now you don't have to open...

A Word Macro To Simplify Resume Generation

I have taken the summer off to look after our kids, get caught up on my todo list (yes it is 2 months long), and do some learning. Now that I am mostly caught up I decided to update my resume but find it hard to remember how many years of experience I have in technologies on my skills matrix. I don't like sending out a resume that shows what year I started with a technology as that does not accurately represent the number of years of experience. I figured that I could compamise on this and have a master...

Going Digital At Home - Part 4 - Digitization Of Media

The most painful and time consuming part of this project has been digitizing our DVD collection. I thought it would be as simple as downloading a program and rip it is done.... not so much in the end. Most mainstream companies are avoiding the area of DVD digitization due to potential issues of the legality of ripping DVDs. Another issue came down to encoding support in the software I tried (most were doing h.246) which would not play on some of my lower powered devices. The other issue is that there are SO many options and settings to tweak that...

Going Digital At Home - Part 3 - The Law

One of the things I never took much time to consider was the legality off all this. My opinion has been (and hopefully always will be) that if I purchased something I should be able to do whatever I want with it. If I own DVD and want to use it as a decoration on my Christmas tree I feel I have that right. Again, I am not a lawyer and this is just a summation of my research on the topic so do your own research for your own area. DVD Backups The first debate is if you can backup or...

Going Digital At Home - Part 2 - Sharing

The next step in providing digital content is being able to share your existing media out to the home. There are several ways to do this. The first thing I want to talk about though is the codec issue. Video and audio can get quite large and there are many different ways to encode media to shrink its size down. In order to play a video you need the proper codec installed (a codec is a bit of code that properly decodes encoded video). The #1 issue with video playback has typically been that you don't have the right codec installed....

Going Digital At Home - Part 1

We have a lot of disparate sources of media around our home. DVDs, CDs, VHS, downloaded content, mp3s, etc. I find it to become more and more of a hastle running around finding the media I want, and then finding the device that can play that. Plus with 3 kids running around it is inevitable that their (and sometimes my) optical media gets scratched or damaged. To that end I have decided to try and go completely digital in our home and felt that documenting it may be of help to others. Infastructure: Wireless network (802.11g) 3 televisions 2 original xboxes 1 xbox 360 1 server (more...

Passing Parameters to a target in MSBuild

On our current project we are using MSBuild to build our application. This is my first time using MSBuild other than just tinkering and I have found it.... challenging to say the least. A lot of my challenges are lack of knowledge but the other half is the language itself. The most recent challenge I wanted to write about was calling a target multiple times. Our scenario is this: We have to generate a batch file for each environment we are going to install in with environment specific settings. The issue I had was that for each environment we had that...

Testing Your Configuration

One common issue of team development is sharing configuration files. If a developer is testing something out and changes a value and then accidentally checks that file in it affects all developers. There are a few approaches to solving this issue: 1) Be very careful and disciplined. +Simple -SImple to forget 2) Have a web.config.template under source control that developers copy to web.config and not include in source control. +Prevents checkins of web.config files that affect other people -Developers need to manually update their config files if a new value is added/removed/or the default updated 3) Have a build script task to generate a config file...

Team City Build Versioning

One of the great things about continuous integration is that we can increment our assemblies version number with each build. For our project we also apply a label to our source code repository every time we build a deployment package. This allows us to get the version of source code from the exact point in time that the msi was built. One of the issues we ran into was that we have three build configurations: 1. "CI" This gets run on every checkin of code 2. "Deploy - ALPHA" This is run manually to deploy to our alpha test environment 3. "Deploy - ALPHA...

Remote MSI Execution

One of the things we have started doing as part of our process is having a build script that creates our deployment package in an automated fashion. We then tied that into our build server so that from one click anyone could create the package. The issue is that we have several test environments and copying the setup.msi file to multiple servers and installing it is a time consuming pain. To streamline our deployment we created a vbscript (yes, it was painful) to remotely uninstall previous versions and then install the new version of the msi. Here is the script...

Return To Blogging

I am finally finding some time and desire to write again. Life has been busy with my both my company and my family expanding. It feels like things are starting to get back to normal again so I should be writing more frequently. Some of the things I have been working with that I hope to write about: nHibernate / fluent nHibernate / Linq to nHibernate WPF Click once Silverlight A fluent .NET build langauage called fluent-build Being a lead on a project ...

Edmonton Code Camp: Call For Speakers

Edmonton Code Camp is happening again this year and we are looking for speakers! Topics are wide open. That means ANY language, ANY technique, or ANY technology. When: September 19,2009 Where: Grant MacEwan Downtown Campus, Edmonton, Alberta Please submit talks to dave@solidhouse.com by August 15, 2009

Book Review: Brownfield Application Development

I was asked to review the soon to be published Brownfield Application Development by Kyle Baley and Donald Belcham. For those who have not heard the term, a brownfield application is one that already has some code developed but is usually not complete. A lot of developers are brought into projects like this and therefore have had no say on the techniques and tools to start developing the application. This book covers how to make an existing application better, more testable, and easier to work with in a simple and accurate fashion. The book is split into two sections,...

Oracle Raises Prices

Oracle has announced that they are raising the prices on the Oracle 11g database. MS has kept the price of SQL Server 2008 the same (for now). I am still amazed that Oracle charges what they do when you can almost get two MS SQL Server licences for the price of one Oracle license. While Oracle has been shown to perform faster than SQL Server 2008 I would much rather have a system that is easier to work with and cheaper than one that I find dificult to work with and out of my clients budget range. Here is a price comparison...

Starting Up The Development Webserver From An Integration Test

Often you will have tests written that hit a service that is going to be hosted via IIS. On our development box we will probably be using the development webserver that ships with Visual Studio. Often the development webserver is not running when we start our tests which causes a failure. To combat that we have all our service tests inherit from a base class that starts up the webserver if it is not already running. This gives us consistent testability: [TestFixture] public class ServiceTestBase ...

Registration For ALT.NET Canada Now Open!

That’s right! After a great event last year we are doing ALT.NET Canada again. This year it will be taking place in Vancouver, B.C. on June 12-14 which is right after DevTeach! In fact we are in the same location as DevTeach so it makes for a great week of training and discussions of some of the best techniques and tools in the industry Registration is limited to 100 people so get in quick. More info and registration can be found on the ALT.NET Canada Website

Parallelism

The big talk lately seems to be about parallelism and writing multithreaded code to take advantage of multi-core/threaded processors. While this is a great way to do more tasks at once it is not usually required for the common line of business apps most of us are writing. Multi-threading is great when you have a big job that can be split appart into chunks for processing on multiple threads. Gaming for instance can benefit a lot from this as gaming is usually a CPU intensive activity. If you are writing a simple app to get things from a database and display...

High Performance Timing

A lot of times we need to know how long a process takes. The simple way to do this is dim startDate as DateTime = DateTime.Now ' do work dim elapsed as TimeSpan = startDate.Subtract(DateTime.Now) Console.WriteLine(elapsed.TotalMilliseconds) For a general sense of time this works fine but this is not entirely accurate. DateTime.Now pulls from a lower frequency clock and can be off by milliseconds (or more). To use a highly accurate timing MS introduced the stopwatch  class in .NET 2.0. This class polls the high frequency clock to get accurate timings: dim timer as Stopwatch = Stopwatch.StartNew 'do work timer.Stop() console.WriteLine(timer.ElapsedMilliseconds) Another thing you can...

Things I Can’t Develop Without: Source Control

Source control is such a crucial tool that I will not develop without that I forgot about it when doing the “Thing’s I Can’t Develop Without” series. For those of you that have never heard of source control (most people have but just in case you have not). It is a simple tool that allows you to check in code to a central repository that records your changes. This allows for several nice features. Versioning. You can easily view or rollback to old versions of code. This allows us to change or delete...

Announcing My New Open Source Project: Fluent Build

I have created a fluent interface around doing builds, allowing users to write build scripts in a simple and terse manner. The project is hosted at http://code.google.com/p/fluent-build/ It is just the start of the project but thought I would get it out there and get feedback earlier rather than later. Here is a sample build class: internal class MainBuildTask    {        private string directory_base;        private string directory_compile;        private string assembly_FluentBuild;        private string assembly_FluentBuild_Tests;        private string thirdparty_rhino;        private string thirdparty_nunit;        private string directory_tools;        public void Execute()        {            directory_base = Environment.CurrentDirectory;            directory_compile = directory_base.SubFolder("compile");            directory_tools = directory_base.SubFolder("tools");            assembly_FluentBuild =...

The Entity Framework Review Take 2

My last post was a bit of a joke and I should explain why after only a few hours of playing with EF that I think it is a horrible technology. Some might say that a few hours is not enough time to completely write off a technology but I have to disagree. I spent a few hours with nHibernate and loved it. a few hours with EF and I wanted to start drinking. First the good things about it: It is integrated into Visual Studio so the whole team is already able to start...

Entity Framework Review

My mother always said that if you can’t say anything nice then don’t say anything at all………         </endPost>

Announcements

I have a few announcements to make so figured I would sum them up in one post 1. Edmonton Code Camp is November 29, 2008 and registration is now open. Hope to see you there (I will also be doing a talk at Edmonton Code Camp on Threat Modeling) 2. Almost a year ago now I brought on Brandon Lang to work for Solidhouse. In that time he has quickly become a great developer and now has launched his own blog! 3. I was selected to be the MVP Insider for November.   Although this interview pales in comparison to...

Save/Open Files Faster

One of the features that I don't use is the shortcuts on the left hand side of an open/save dialog. I don't use my My Documents for storing files as I find that so many applications store their settings and other garbage in the My Documents folder that it is useless. Instead I have a folder on the root of my drive that holds most of my stuff in a form that I like... I just wish it was faster to access. After about 2 seconds of searching I came across this article that describes how to customize the...

DevTeach Is Upon Us!

Well it is getting really close to that time of year again. I am talking about one of the greatest conferences ever.... DevTeach! Some of the great things about DevTeach: Great size. There are enough people to make it a big conference but still small enough that you meet a lot of people Great speakers. I have been to DevTeach as an attendee three times now and I can not think of one talk that was disappointing Great tracks. Every year there are some great standard tracks like agile, architecture, web, .net, sql. There is also some specialized...

Yes, I Am Alive

Sorry for the lack of posts lately but I have been vacationing in Taiwan. Now that I am back I am busy working away on my talks for DevTeach in December: Enabling Partial Trust In ASP.NET Applications Passwords are Dying - Options For A More Secure Future Threat Modeling I will be spending quite a bit of my time getting them ready so the blog will probably be fairly quiet until I am satisfied with my presentations.  

Smart Client Deployment To Different Servers

For my current client we have an environment where the application is handed over to a deployment team that installs it onto varying test servers. For good reason these servers are locked down and the development teams can not access them. This ensures a clean install and ensures that the version in the test environments gets moved forward only if there are no issues. Problem 1 - Setup.exe has "baked in" URL This plays a bit of havoc when deploying smart client applications. One of the reasons for this is that the setup.exe bootstrapper has the URL baked...

Things I Can Not Develop Without: Resharper

Resharper has to be one of the biggest boosts I have found to my productivity. This tool has so many little time saving features that I will probably gain days of productivity every month. For anyone that has not heard of this tool, Resharper is a visual studio add-in made by JetBrains that adds a plethora of time saving shortcuts. I thought I would share a few of my favourites: alt+enter some context sensitive help. For instance if you write a line like this: ICustomer customer = new Customer(); ...

Things I Can't Develop Without: Removing Pain

Recently I have been helping several other developers in the shop I am consulting at and realized another item for this series: Removing Pain. I am amazed by how many times I see developers repeating the same things over and over again. Builds/Deployments Builds should be the simplest and most repeatable thing you do in a day. If you have a checklist on your desk of steps then stop and automate. It is such a time saver to have a script that will do the things you need it to do. Wether it...

Great nHibernate Course Offering

If you have ever wanted to learn nHibernate from an experienced developer now is your chance. The one and only James Kovacs is offering a three day nHibernate course in Calgary this August that you don't want to miss. James is an expert in nHibernate and I could not think of a better person to offer this course.  Check out the announcement on his website: http://www.jameskovacs.com/blog/CourseAnnouncementObjectRelationalMappingWithNHibernate.aspx

Introducing PIP (Programming in the Park/Pub)

One thing that really irritates me is the lack of knowledge transfer in our industry. I have been thinking of ways to help fix this and came up with the idea of having a weekly or bi-weekly meet up of fellow Edmonton geeks to just sit around and learn from each other. To accomplish this I am going to setup an informal meet up where people can show up and just work on whatever they want or just go randomly pair with someone. This is meant for all levels of developers So far I have a...

Things I Can't Develop Without: Contracts

No, I am not talking about legal contracts, I am talking about code contracts. What is a "contract" in code? It is simply defining a piece of code (usually an interface but sometimes an abstract class) that defines what the implementation will do. Then every piece of code talks using the contract and not the actual implementation. This becomes very very useful when you need to extend/intercept/modify a class. The first time I used contracts for development effectively was on a system that needed to find people. The interesting thing was that a person could exist in...

ALT.NET - Only Three Spots Left!

The alt.net registrations have filled up fast. We had a few fake entries registered so now that I have cleaned that out we have 3 spots left. If you want to come join us in (currently partly sunny) Calgary then head on over to the site and register http://www.altnetconfcanada.com/ Hope to see you there!

Things I Can't Develop Without: Test Driven Development

Now here is a topic that has been beaten to death in other blog posts but it needs to be on this list. If somehow you have missed the buzz around Test Driven Development (TDD) it is a great way to drive out the design of your software by writing a consumer of your code (the test) first. This way you design very intuitive and easy to read code. I must stress that TDD is primarily a design methodology NOT primarily a testing methodology. By using TDD you design good code and get unit tests as a side effect....

Things I Can't Develop Without: Single Responsibility Principle

Using the single responsibility Principle (SRP) is one of the best changes I have ever personally done to the way I develop software. To boil things down, SRP means that a class should have one, and only one reason to change. The way to accomplish this is to write a class that only does one thing. Now most developers I have worked with may have something like this in their code: public class CustomerUtility { public void Save() public void SaveOrder(Order order) ...

A Few Announcements

1) I am alive. I know I have not posted much lately but I have been working like crazy on a project for my current contract. This has given me lots of material for more posts though so watch for those 2) ALT.NET Canada is open for registration http://www.altnetconfcanada.com/ and it is happening on  August 15-17th. Register soon as space is limited and filling up fast! 3) Happy Canada Day!

MVP in Security

Although the timing is funny this is not an April Fools joke. I was awarded a MVP award for Security today. Another local Tom also got an MVP for C#

Happy Birthday Igloo Coder!!!

That is right today is the one and only Igloo Coders birthday! Justice asked us to write our favourite story of Donald today. I figured I would tell a mostly true story about DevTeach Montreal. Now Don and I found this great little place called Ye Olde Get Way To Drunk And Try To Find Your Way Home... or something to that effect. This is usually the place we started and ended up at.           The staff were great...

Something Different In Blog Land

A while back I found Sara Ford's blog (it actually says weblog in the title.... weird... what is a weblog?). Unlike everyone else, Sara just posts tips on the IDE. From shortcut keys, docking tips, to other hidden little gems. I find it a really refreshing and helpful blog especially for those of us addicted to shortcut keys.

It is not a great day to look for work in Edmonton

Well back in e-town we have hit our cold spell like we always do. I decided to check the weather out and saw a great add from workopolis above the weather. I will leave it for you to decide if "It's a great day to look for a new job in Edmonton"

HTML 5 Draft Released

The long awaited HTML5 draft is out. I had a quick look at it looks to be more of depreciating old things than anything else. Some absent tags of note: center, u, strike, frame, frameset, and noframes (frames are removed due to accessability issues.... and they were always a pain to work with too) A lot of other attributes have been removed that are now handled (and handled better) by CSS. Some of these are things like bgcolor, align, valign, background, cellpadding, and cellspacing to note a few. A lot of the new stuff revolves around media. There is the addition of a  videa...

New Year - New Direction

I have always tried to write my blog towards the common developer (aka the intermediate programmer). I feel that this is the often neglected programmers; experienced enough to do some things on their own but not experienced enough to do everything on their own. So I started writing little tips and notes with those developers in mind. I have really enjoyed seeing my readership grow to people all over the world. In a former life I used to do security work on the networking side and really enjoyed it. I have found that passion with security on the...

Tortise Global Ignore

One of the annoying things with using Tortoise SVN I have found was that I always have to exclude the bin, obj, and .suo files that are unique to each machine. Even if I did that someone else on my team might forget which just makes it a huge pain. I thought there must be a better way and sure enough there is a global ignore setting in the tortoise settings panel (just right click on any folder and select TortoiseSvn -> Settings). Right on the front page I noticed the global ignore setting: So far my global pattern is:    ...

Checkins

One thing that I have picked up as a good habbit is when to check source code in. I remember a day when I would check out in the morning and check it in when I went home. The best habbit I have gotten into is doing a checkin when the code is in a working state. This could be when all of my tests pass or when a manual test is successfull (if you don't have tests or good coverage). I think this probably happens more due to the use of a continuous integration server that you can get...

Interface Chaining in VB.NET

One beef I have had with vb was that I thought you could not chain interfaces like you can in C#: Public Interface ICommand: IDisposable { void AddParameter(string name, object paramValue) IDataReader ExecuteReader() int ExecuteNonQuery() Object ExecuteScalar() } Finally a colleague of mine told me that instead of implementing an interface on an interface you inherit the interface like so:Public Interface ICommand Inherits IDisposable Sub AddParameter(ByValname As String, ByVal paramValue As Object) Function ExecuteReader() As IDataReader Function...

NDepend

I have been playing with NDepend for the past few months and am quite impressed. The sheer power of this tool has been quite intimidating and I have been putting off this post as I really wanted to learn NDepend before I wrote my opinions (I still don't know it very well but that will take more time) For those who have not hear of it, NDepend is a great analysis tool that quickly and easily allows you to spot issues in your code base. It ships with over 50 built-in metrics some of which are number of lines...

Risk Management

Under agile, risk mitigation is a very key concept. Instead of talking about and being aware of risks, the first thing we try to do is to eliminate the risk.   When starting a project take a look at overall project risks and attack them so they are no longer a risk for your projects success. A possible example is: will WPF work as a technology for us? The first thing the team should do is create a quick prototype application to see if I can get WPF to work for our situation.   With every iteration take the time to look for...

"It costs too much to implement testing"

This is the most common defense I hear when I talk about implementing testing on a legacy project. To this I want to walk through a scenario for finding and fixing a bug in a common organization. I know that not every shop runs like this and that every bug is unique but just humor me for a minute. Role Task Time (in hours) User User notices something unexpected and tries to work around it themselves 0.5 User User finds the number for the helpdesk and reports the issue. The helpdesk attempts to troubleshoot the...

RUP User Group - Scott Ambler

So a Rational Unified Process Group started up here in Edmonton in October. I have no knowledge of RUP so I thought I should go check it out and Scott Ambler was the first presenter. Although by the end I did not have a real feel for what RUP entirely was I got loads of good information from Scott about the realities of software. It was also interesting to have about five people from Calgary join the presentation via a phone conference. Software Development, Agile, and RUP In the U.S. the Department of Defense funds 60% of Computer Science...

Edmonton Code Camp Materials

As promised here is the presentation materials from my partial trust talk at the Edmonton Code CampPartial Trust.zip (1.18 MB)

Book Review: The Pragmatic Programmer

After Justice Gray's bubbling fan boy review of this book I thought I should go and check it out. I have to say I almost share as much enthusiasm as he does. I found the book really well written and concise. The book goes though many of the things I have learnt the hard way like duplication is evil, designing by contract, minimize coupling, and a bunch more. I found everything hits the nail on the head without killing the hammer. I never found myself disagreeing with the book or thinking something should be added. To me that is pretty...

Stop Biting Your Tongue.... It Hurts!

I was going to write an ALT.NET recap article but I think James and Donald really said everything I would have said. Instead I thought I would write about what changed since I got back.One of the things I came back with from the ALT.NET conference was a lot of renewed energy in that the way I am trying to develop software is the way a lot of talented industry people are developing software. Now not to say that I want to follow what person xy does dogmatically, I want to combine ideas and techniques into what works for me...

Code Camp Is Comming! Code Camp Is Comming!

The 2nd annual Edmonton Code Camp is going to be held on October 20th, 2007 at the UofA. I must say I am excited on this one! Maybe because a bunch of us are fresh off the ALT.NET or maybe becuase I am finally doing a full fledged presentation here! Either way I am looking forward to all the great conversations and questions to be had. Last years camp was really well done so this one should be even better. The organizers have added another track bringing the total up to three. This has allowed for five more sessions to be done. Hopefully you are...

Austin ALT.NET - Session 6

Executable Requirements I really had never heard the term Executable requirements comming into this talk so thought I would see what I could learn. An executable requirement is a requirement written in such a way that  user (or BA usually) can read / write it and it can also run against our code to test it. FIT is the best example of this. Some people here have used fit/fitness but most people have had pain with it (FITNESS is the wiki. FIT is the dll)-Refactoring with fitness was hard-It turns into a lot of overhead-There are problems with source control (TFS/VSS can not...

Austin ALT.NET - Session 5

Spreading ALT.NET The guy who is running(?) MSDN mag was here and really wanted to learn about the community and bring some of these ideas into the magazine. This was good as there is lots of talk about the divide between alt.net and Microsoft so this is a positive sign coming from MS. James Kovacs had a good point that e are in an echo chamber and need to find how to spread the word.Some ideas to do it:-Speaking at user groups-INETA speakers bureau-Codezone-Tying it to MSDN-Including open source tools and techniques  in sample apps-Focus on concepts, not specific frameworks-When showing a...

Austin ALT.NET - Session 4

DDD-itsu Ok I feel over my head here to start out with. Mostly because I have not done DDD on a project (well to its full extent). There was debate over: Account.depoit / account.withdrawvs. A service implementation like:WithdrawServier service = new WithdrawService(account)service.withdrawAmount(100) Which was an interesting debate but really comes down to implementation and complexity. Account.deposit/withdraw does violate SRP but on the other hand when you are modeling the domain I think you should be MODELING THE DOMAIN so an account can do deposits / withdrawls (IMHO) The debate was expanded in more detail to this:public class TransferService{  function Transfer(from, to, amount)  {       from.balance...

Austin ALT.NET - Session 3

ASP.NET MVC I had no idea that Microsoft was coming out with an MVC (Model View Controller) implementation . I am kind of excited about this one (everyone else was too as everyone came to this session, seriously... everyone was here). I have tried playing with monorail and have not been terribly impressed so hopefully something a bit more integrated and refined would be good. Whether MS pulls it off remains to be seen. This is one hard to blog about unless you have used an MVC implementation like rails so I will talk about other stuff. I have liked a lot...

Austin ALT.NET - Lunch

Lunch was some big tasty sandwiches but the talks were better. We got onto the topic of parallelism which was quite interesting.  Scott Guthrie  got up onto the whiteboard to talk about scaling applications List<person> peoplefor(i=0;i<people.Length(); i++){   person.DoTask();}this code will not scale as the interpreter cannot easily split this code across processors. As a programmer you may be able to write some code that starts new threads and does locking but it might perform even worse (due to managing your locks) or might work on two processors but will not scale up to 400 cores The power comes from lamda expressions and...

Austin ALT.NET Session 2

Boo Boo is python-like (whitespace delimited, colons to start methods)lots of jokes about BOOBS (Boo Build System)Boo has a compiler, an interpreter, and an interactive shell (booc, booi, booish respectively)imports system.drawing from System.Drawing <-load something from the GACorimports system.drawing from “c:\System.Drawing.dll” <-load something from the filesystemSo here are some commands and what they do in boo:f= Form() ß as the brackets are specified it must be a constructor so no new keyword is requiredf.Show()b = Buttton(Text: “Click”)f.Controls.Add(b)b.Click+= { b.height+=3; b.Width+=5 } ß anonymous methodb.Text = “Time is $(DAteTime.Now.ToString(‘t’))” ßeasy way to inline variablesprint b.Text ßoutput to console is easya = (...

Austin ALT.NET - Session 1

The first talk I went to was about Domain Specific Languages We started with introductions and experience. No one knows anything about DSLs.... great Defining a DSL – We basically decided that a DSL was a language that can be used to describe a problem or domain. Whether this is for the business user or the programmer is a debate I do not think we will solve. Good examples of DSLs we use: Outlook rules engine is a very good example. Another one was searching where we can use quotes and other symbols to narrow our search. Testing a DSL is hard. Quote someone...

Another Book Review: Refactoring Databases

Wow getting your wisdom teeth pulled has somehow really opened up my schedule and allowed me to get a lot of reading done lately. I recently picked up Refactoring Database: Evolutionary Database Design by Scott W. Ambler and Pramod J. Sadalage This book is part of the Martin Fowler Signature series and it shows. The book had the same format as the others in the series which had a nice constancy and was easy to just pickup and read whenever. I found that the book was well written and that the tradeoffs and implementation strategies were well written and...

Fundamentals

Jeremy D. Miller just put up a really good post on some fundamentals. Check out the post here

Book Review: Working Effectively with Legacy Code

I got my wisdom teeth taken out on Wednesday and decided to read my new copy of "Working Effectively with Legacy Code" by Michael Feathers. To sum it all up.... I would rather have my wisdom teeth removed than recommend this book to anyone who has any experience with legacy code. I found that the book was a wrapper for Martin Fowlers Refactoring with a lot of buzz words like TDD, SRP, OCP, and more scattered liberally throughout the book without much about applying these ideas to legacy code. I think that if you have read Refactoring that you...

Book Review: Framework Design Guidelines

    At the last edmonton user group meeting I finally won something (besides a t-shirt :D). I won a copy of Framework Design Guidelines by Krzysztof Cwalina and Brad Abrams.     I had heard a lot of good things about this book from others but really had no motivation to buy it. The title is way to exciting and if I leave it out girls might be breaking down my door just to touch it (the book you sickos!). I must say that I was pleasantly supprised with the book and definately think it is worth having a read for...

Published... sort of

An article was out in the Edmonton Journal this weekend about the current project I am doing part of: http://www.canada.com/edmontonjournal/news/cityplus_alberta/story.html?id=11b4ff4f-fd95-495c-a339-5e23ced4de86&k=79586

Accessing The GAC

Derik Whittaker had an interesting post about how to access the GAC as though it were a regular file system called Hacking the GAC. A few interesting and different ways were posted that I had never heard of. The simplest way that I know of is to go start->run and type in c:\windows\assembly\GAC and the cache will open up just like a filesystem. We actually used this on one project where we could only use third party assemblies on the clients network. What we would do was develop locally (because our net connection in the office was way to...

Good Quote

My project manager had a qood quote about impossible deadlines I thought I would share. "you can not make a baby with 9 women in one month" Very suiting quote for lots of projects I have worked on.

Setting A Label From A Different Thread

We have the scenario where multiple labels values are being set from a different thread. When this happens an exception is thrown as labels (and most other controls) are not thread safe. To get around this you can have the hosting form do a BeginInvoke to queue the message to the proper thread (I think that internally it does a SendMessage to the form to do the actual work). To do this I create a delegate to a method that sets the labels value:Private Delegate Sub SetLabelDelegate(ByVal value As String, ByVal label As Label)Then I create the method:   Private Sub SetLabel(ByVal value...

Things I Learned About FoxPro

On my current project I have to connect to a legacy FoxPro2 database. I know nothing about FoxPro but it was fairly easy to connect to and use in ADO.NET. I had a few stumbling points that I thought I would share in case you have to connect to one. 1. Named parameters are not used by oledb/odbc commands. They are ordinal and represented by question marks:command.commandText = "insert into users (firstName, lastName) values (?, ?)"The commands then need to be added in the correct order:command.parameters.add("@firstName", customer.firstName) command.parameters.add("@lastName", customer.lastName) I know I show the parameters as named in the add() method...

Datasets Vs. DTOs

On my current contract the powers that be feel that datasets are the way to go for everything and it has become their new standard. While I feel that datasets are powerful and useful in some (rare) situations I feel that this is a bad idea. I did not find much on the comparison between the two techniques so I thought I would write one up. Please don't take this as an attack on datasets typed or untyped). I am just pointing out why I avoid them for most apps. I appreciate any contributions to this post either for or against...

Serialization

I got a little sidetracked with a problem due to an assumption. What I am doing is returning a proxy to an object to my client. I started to think what would happen across my serialization boundary. I assumed that the serializer would access all the properties and send their values across the wire to be reconstituted on the other side. Well, I was wrong. What serialization will do is serialize all the private fields and move those across the wire and then repopulate all the fields on the other side (via reflection). This is clearly obvious now as...

ReSharper 3.0

So ReSharper 3.0 was released and I see that it does have VB support finally (although I don't touch as much vb as I used to I keep hitting the shortcuts and getting mad when nothing happens). The thing that gets me is that you only get a free upgrade if you purchased 2.0 or 2.5 after April 15th, 2007. I really like resharper but I don't see dishing out $200 when I got my license for 2.5 in Feb. I guess I will just stick with 2.5 and keep avoiding vb :D

Something cool from.... Microsoft?

I found this to be a really cool and promising idea: http://labs.live.com/photosynth Basically you will be able to upload your photos of an area and the app will join them togeather to form a model in which you can navigate. Pretty cool stuff. I can see lots of potential in it leading up to forming 3d models from joining several 2d photos (it kind of is already doing that I guess).

Unexpected Results

While working on a presentation about iterative hashing techniques (hashing a hash n times to make it harder to break) I decided to do a few simple performance tests to see what the time tradeoff would be for more iterations. The results though confused me. When running a thousand iterations it took an average of 0.36 seconds but when I upped the iterations to 10,000 the process took less time (0.19 seconds average). I am not 100% sure why this is happening. Iterations Time (seconds) 1,000 0.36 10,000 0.19 100,000 1.32 Here is the code I am using...

Code Camp Presentation Source Code & Resources

Thank to everyone who came out to see my presentation at Calgary Code Camp. No heads exploded so I think it was a success. Here is the source code and a few references.Source CodeJoyOfReflection.zip (47.6 KB)ResourcesReflectorMSDN OpCodes ListMSDN Reflection.Emit ReferenceHappy Reflecting!

Impersonating An Identity Temporarily

I have always had problems with my current app as it has to impersonate a user to consume various different components and databases. Testing components in isolation is tricky with this setup. I did find a handy way to have a test impersonate a user for a test run: Imports System.Runtime.InteropServices Imports System.Security.Principal Public Class Impersonation     Implements IDisposable     Dim impersonationContext As WindowsImpersonationContext     <DllImport("advapi32.dll", SetLastError:=True)> _    Shared Function LogonUser(ByVal principal As String, ByVal authority As String, ByVal password As String, ByVal logonType As LogonTypes, ByVal logonProvider As LogonProviders, ByRef token As IntPtr) As Boolean    End Function     <DllImport("kernel32.dll", SetLastError:=True)> _    Shared Function CloseHandle(ByVal handle As IntPtr) As Boolean    End Function     Public Enum LogonTypes        Interactive = 2        Network        Batch        Service        NetworkCleartext =...

My biggest COM+ issue solved

I have a com+ component that I have been involved with for years. It lacks tests but I wrote functional tests at the interface level which surprisingly has fairly good coverage of the code. The issue with this is that the component HAS to impersonate an identity for the tests to work properly. So I have a pre/post build condition that installs / uninstall's it from the gac/com+ catalog. My only manual intervention was to set the identity (every freaking time I wanted to run my tests). To help with this issue I installed autohotkey which is a great...

Why Contractors Charge More

I posted about this a while back along the fiscal side of it but there were a lot of things that I did not mention. -We get zero benefits. That means if we are sick for a week, month, year we don't make any money yet still have to pay our bills somehow. If you go to the dentist shell out (unless you have purchased your own coverage of course) -We do not qualify for EI. Being self employed means that you don't have to pay into EI (w00 h00) but it also means that if a contract ends we...

Great Captcha Article

Coding Horror has a great article about CAPTCHAs up which cna be found here. I have seen / heard of programs that defeat captchas but ideas like the turing porn farm (read the article about this) are a smart way to defeat captchas or any other human / machine difference engine but not widely implemented (yet). I also like to bring up the point that CAPTCHAs prevent the visually impared from validating themselves. I have seen some websites that have an audio clip that the visually impared can use to validate but this is fairly uncommon.

Edmug Presentation Tonight

Well they finally got me. Tonight I will be presenting at Edmug along with Donald Belcham, Justice Gray, Christina Gray, and Steven Rockarts. The presentation should be an interesting change as Edmug has never had a panel presentation. Tonights presentation will be about our favorite tools. So besides Nunit which should be everyones favorite tool, I decided to do a presentation on Adepts SQL Difference tool which I use regularly to compare two databases to generate my scripts for the next environment. While it should be a simple tool and presentation I have been supprised at how many people do not...

VS 2003 SP1 is here!

 Service Pack 1 for vs2003 is finally here and all 156mb can be downloaded from ms's site here. A list of bugs fixed can be found here.

.NET Design Patterns

I have been reading the ever-classic "Design Patterns: Elements of Reusable Object-Oriented Software". I am a bit behind the times on picking this one up as it was published in 1995. Still a good read if you have no idea about patterns. All the examples are in c++ which is a little hard on the some of the pure .NET developers who have read it. Also some patterns use multiple inheritance which we don't have in the .NET world. I did happen to come accross this site which has all the patterns from the book updated to use .NET and...

Life as a contractor

I have been contracting part time for ages but decided to take the plunge and go full time in feb of 2006. It is an interesting switch and I thought I would share a few points about it that seem to get contractors into trouble:1. As you are your own boss it is easy to slack off (hence me blogging / golfing this afternoon but hey... it's Friday!). I use the time sheet functionality in simply accounting that has a start and stop button to record the hours I actually work. Whenever I slack off I hit stop and when...

Great solution to the "terminal server has exceeded max number of allowed connections" message.

Once a server has exceeded 2 connections (in a typical config) you will get the error "terminal server has exceeded max number of allowed connections". I get this all the time after my net drops.I found a cool way to get around this other than logging on locally / rebooting the system. Remote desktop also has an option for a console login (just like if you were to be at the physical system). This will allow you to have a 3rd session in which you can disconnect your expired sessions. To do this type mstsc /v:ServerAddress /f /console(the /f is...

TDD step by step

 Jean Paul just posted a great video along with code on doing TDD (along with rhino mocks) on his site. Check it out here

Backups are important

I think backups are usually the most poorely done thing in any organization. Even if you have a backup solution it is very rarely checked to ensure that it is working.1. How often are backups verified / tested. If possible I recommend taking a system and restoring your backup to it and see if everyone can still work.2. How old are your tapes? They don't last forever you know. I don't know the average life but I am guessing at 1-2 years depending on rotation.3. Do you have a rotation (i.e. a tape for every day of...

TDD Last Night

Normally I don't post about life stuff but this is code related. Last night I went to the first edmonton .NET user group meeting and had a great time. Jean-Paul Boodhoo was the presenter and did a great talk about test driven development amongst other things.I have read about TDD and all sorts of patterns books but found them hard to know when to apply them in the real world. JP's presentation was a begging to middle (we ran out of time unfortunately) coding sesssion using TDD to build an application. The cool thing was that we built the application from the presentation tier down pretending that other...

Setting JPEG Quality

I have many applications that create thumbnails or manipulate images. When I save these as jpegs the quality kind of sucks though. Took me a while but found a way to set it by way of using one of the image.save overloads to pass the encoder to use (in this case the jpeg encoder) and parameters to that encoder.Here is the method taht finds the right encoder based on mime type: 1 private static ImageCodecInfo GetEncoderInfo(String MimeType) 2 { 3 ...

Removing while iterating through a collection

Often times developers want to loop through a collection and filter out items. Unfortunatley they get the error that they can not change the contents while enumerating it. There are 2 solutions to this problem1. Copy the records to be removed to an array or collection of some sort and then remove them in a second loop2. Run it through a for loop backwards and remove the entries as needed Dim refRow As dataRow For i As Integer = ds.tables(0).Rows.Count - 1 To 0 Step -1 ...

Thread Locking

One thing that you have to worry about in a multithreaded application is the problem of concurrency in that you do not want two seperate threads acessing a value as it is changing. .NET has a method to solve this and it is called locking.In c# it is Lockvb it is SyncLockpublic property GetId() as integer get syncLock me return _id end syncLocl end get set (value as integer)...

Controls and Threading

    Controls are not thread safe! you should never try to access a control or modify it from a different thread than the one the control exists on. If you do strange results will happen.Fortunately controls have two methods that help us overcome this issue with ease.control.invoke() to do simple tasks and control.beginInvoke() for longer running tasks that we want to have happen on a background thread.Here is a simple example of using beginInvoke()dim params() as object = {me, System.EventArgs.Empty}control.BeginInvoke(new System.EventHandler(Addressof UpdateUi), params)private sub UpdateUi(sender as object, e as eventArgs){ lblStatus.text = "Finished"}as you can see we pass in an array...

Objects make code expandable

    thats pretty much it. I am a big fan of oop and am working on a project that is not. It now takes me so much longer to do anything and it has a huge impact on the code base and its consumers.I have one method like this:CreateCashout(clerkId as integer, officeId as integer, cashTotal as double, creditCardTotal as double, debitTotal as double, PaymentIds() as integer)This is then validated and passed to the same method signature in the data layer.So for one I have a long method signature. Some of these items will be zero (i.e. debit totals for some consumers) so why make them put...

Throwing Exceptions Part 2

Sometimes you need to change an exceptions type (usually to a custom exception type) but still want to maintain stacktrace information (read about this issue in part1). Well it is really easy just look at this example 1 2 Public Sub Layer2() 3 Throw New NotImplementedException 4 End Sub 5 6 Public Sub LogError(ByVal ex As Exception) 7 ...

Throwing Exceptions

    Don't do this: 1 Public Sub DoTask() 2 Throw New NotImplementedException 3 End Sub 4 5 Public Sub LogError(ByVal ex As Exception) 6 'TODO: log the error 7 End Sub 8 9 Private Sub Button1_Click(ByVal sender As...

System.Net and max number of connections

when using HttpWebRequest, HttpWebResponse, The webBrowser class or pretty much anything relating to doing HTTP transactions there is a limit on the number of connections you can have to a server. This limit is defined by the HTTP RFC (no idea what number it is). This is why with internet explorer you can only download 2 files from a server at the same time.Unfortunately with building an application you might have 30 clients all requesting a component that calls out using one of the HTTP classes.<configuration> <system.net> <connectionManagement> <clear/> ...

Boggled by Logistics

Check this out: http://preview.local.live.com/basically allows you to drive down streets in Seattle or San Fran.What really amazed me was turning to the side and seeing a picture of a store front. I have no idea how all of these pictures could have been taken and assembled.I am waiting for a real time driving simulator now so that I can get around a city before I arrive there (sorry I am a dork).

Side by Side Versioning With COM+

Today I discovered that when you try to install a com+ (or enterprise service if you want) componenet written in 1.1 of the framework on a system that has 2.0 also installed that you can not install some componenets. I have no idea why or how to fix it besides uninstalling 2.0 then installing your componenet. Then reinstall 2.0 after if you need it....weird!

Unit testing and the database

I have been playing with unit testing for over a year now and really see the value in it. Most of the time you build your tests along with (or before in the case of test driven development) your code. But I have even found it valuable to write tests for code I have already written in the past if I am going to have to make a change. I usually only write a test for the method I am about to change, make my change and then see if my test still passes.One of the things that I hate is how many articles recommend to mock...

My toolbox

-FxCop. Great tool for keeping code consitant-Nunit. Unit testing tool-CopyAsHTML (great for blogging / documentation)-DataSet Quick Watch (http://www.codeproject.com/csharp/DSWatch/DSWatchSetup.zip) Great tool for seeing a dataset in a datagrid while debugging-Firefox FFox plugins -IE Tab (opens a page that is only ie compatible within firefox) -Sage (nice little newsreader) -Web Developer (if you do work with the web get this... period) -Adblocker

Marking a method as obsolete

I am currently working on an enterprise system that already has several consumers. There are several methods that have been replaced by newer methods and I want the clients to stop consuming the old ones. Unfortunately if I just tell them to use the new ones they wont, and when I release a new version and it breaks they will complain. I found a neat way to deprecate a method 1 _ 2 Public Function oldWay() As Boolean 3 4 End Functionnow whenever...

XSTL / XML and the information bar

I am trying out XSLT w/ XML for a project I am doing. Basically the website has a page for each staff memeber with a bio, phone, website, email, photo, etc. The client does not want to pay for a database solution which I would normally do so I decided to try XSLT (If you have no idea what XSLT is you should check out the quick tutorial at www.w3schools.com). Well found a few snags but the one that bugs me the most is the information bar in internet explorer that says it "blocked content that may harm my computer". After some playing and diggiing I found that...

Gateway Pattern

One of my favorite patterns is the gateway pattern. Basically it is setting up one class that all requests for a certain action run through. The time I use this the most often is when accessing an external service.For example lets say that I use an external service multiple times in an application (in this case I am accessing over a webservice but it could be com, remoting, a database, almost anything)In my example I have an external web service that I use to find the customers ID via a phone number. 3 Public Class Payment 4 ...

Classifying Programers

I was recently asked in an interview how I classify programmers. I found it interesting as there is no set classification of programmers. Here is what I came up with:Junior Programmer-Programmer has difficulties with the language itself (e.g. declaring objects, using properties, sizing of arrays)-Programmer is not familiar with a lot of the builtin functions/objects in the language (e.g.-Programmer is not comfterable / aware of OOP.-Programmer usually has no understanding of interfaces-Programmer usually can not forsee how to implement a solution and needs to be instructed on the steps to take to acheive the end result.Intermediate Programmer-Programmer is comfterable with the programming language-Programmer is...

Getting current method info via reflection

I have an application that logs information when each method runs: 1 Public Function GetRefundsByID(ByVal id As Integer) 2 'implementation 3 4 LogMessage(String.Format("GetRefundsByID found {0} records", count)) 5 End FunctionI dont really like this as I have now hardcoded the name of the function into each method which really sucks when I rename a method.I managed to figure a way to get the current method name...

Parsing File / Directory Strings The Easy Way

I recently discovered some builtin classes to parse file paths instead of awkward .IndexOf / substring combinationsdim filename as string = "c:\windows\temp\stuff\myfile.txt"the IO.Path has many shared methods that allow parsing and manipulationIO.Path.ChangeExtension(filename, "xml") 'c:\windows\temp\stuff\myFile.xmlIO.Path.Combine() 'have not played with this one yetIO.Path.GetDirectoryName(filename) 'c:\windows\temp\stuffIO.Path.GetExtension(filename) ...

Custom Event Args

I don't know if there is a name for this pattern or not but I have found that it is quite helpfull. When creating custom events it should only have two parameters. One being the object that raised the event and the other should be an object containing data.I like examples so lets start with these two classes:public class MyApp private withEvents eventClass as MyEventRaiser private sub DoTask() eventClass.DoTask() ...

Heap vs. Stack

I found these three articles really good regarding the heap and stack.Part Ihttp://www.c-sharpcorner.com/UploadFile/rmcochran/csharp_memory01122006130034PM/csharp_memory.aspx?ArticleID=9adb0e3c-b3f6-40b5-98b5-413b6d348b91&PagePath=/UploadFile/rmcochran/csharp_memory01122006130034PM/csharp_memory.aspxPart IIhttp://www.c-sharpcorner.com/UploadFile/rmcochran/csharp_memory2B01142006125918PM/csharp_memory2B.aspx?ArticleID=c31e9a39-d364-429f-a4fa-0a60444d3add&PagePath=/UploadFile/rmcochran/csharp_memory2B01142006125918PM/csharp_memory2B.aspxPart IIIhttp://www.c-sharpcorner.com/UploadFile/rmcochran/chsarp_memory401152006094206AM/chsarp_memory4.aspx?ArticleID=4f58d369-9e0c-4f7a-8a84-5883faade356&PagePath=/UploadFile/rmcochran/chsarp_memory401152006094206AM/chsarp_memory4.aspx

Delegates in vb.net Part 3

The next item in delegates I want to cover is returning data. In my previous example we called a sub that did a task (writing out a file) but it did not return any data or notify us that we were done. To accomplish this we are going to use a delegate with a callback method.Here is the code I am going to start with:Private Sub StartTask() Dim del As New DoLongTaskDelegate(AddressOf DoLongTask) del.BeginInvoke("c:\temp.txt", Nothing, Nothing)End SubPrivate Delegate Function DoLongTaskDelegate(ByVal filename As String) As IntegerPrivate Function DoLongTask(ByVal filename As...

Delegates in vb.net Part 1

    A delegate also has built in methods that allow background execution of the method it points to which is what we are going to use here. Most times I start a task on a background thread I use Thread.Start(). Unfortunately if you have a method that takes parameters you can not use Thread.Start. Instead we will use a delegate which will allow us to pass parameters to a method running on another thread.I have a project where I need to write to a file on a background thread. The WriteFile method takes one parameter (the file path).public sub WriteFile(byVal outputFile as String) ...

Delegates in vb.net

    For those of us that are not C# developers we rarely deal with delegates. A delegate is simply a strong typed pointer to a method. C# uses this extensively for wiring of events. VB.NET actually builds the event delegates for us behind the scenes.Here is a quick example of a simple delegate:Public Delegate Sub TrafficLightChangedEventHandler(ByVal color As String)Private Sub TrafficLightChanged(ByVal color As String) MsgBox(color)End SubPrivate Sub StartDelegate() Dim del As TrafficLightChangedEventHandler del = New TrafficLightChangedEventHandler(AddressOf TrafficLightChanged) del.Invoke("Red")End SubWhen startDelegate gets called we create an instance of the Delegate and...

Image overlay using GDI

Recently I was asked to build a website that when a property got sold a little sold sticker appeared in the upper corner of the image. I thought this would be really hard based on my experience with php image manipulation. With .NET and GDI+ it was so easy. Here it is:Dim baseImage As ImageDim overlayImage As ImagebaseImage = Image.FromFile("c:\house.jpg")overlayImage = Image.FromFile("c:\loginButton.jpg")Dim gr As Graphicsgr = Graphics.FromImage(baseImage)gr.DrawImage(overlayImage, 10, 10)Me.PictureBox1.Image = baseImageThis is easy to change to load from a stream / save it to a web output stream (baseImage.Save(Response.OutputStream)).

Refactoring and Comments

If you have not read Martin Fowlers book Refactoring then you should. There is no book that I have read that has helped me more in what I do everyday. The book basically gives techniques on how to make code better and easier to work with after it has been written. One of the most used and common refactorings is "extract method". This is where you take a chunk of code and pull it into its own method. (eg. http://www.refactoring.com/catalog/extractMethod.html).I so love the idea that a method does one task and that is it. If it does two tasks then the method calls two methods (one for...

.NET string comparisons

typically most developers compare strings in a case instensitive way like this:if var.toLower = "expected" then ...end ifthis way is a little inneficient and does not take into account cultural differnces (some languages use groups of letters to signify one letter, some letters follow uppercase / lowercase rules differently).for comparisons I use this everywhere now:If String.Compare(var, "expected", True) = 0 Then...end ifI wish it would return a boolean though. it returns less than 0 is var is less than expected0 if they are equalgreater than 0 if expected is greater than var

Debug and Release config files

One of my biggest issues was having certain lines in my config file for working in my developement shop and others for production. Whenever a bug was found or the application was released you would have to swap configs around. After a few years of reading I happened accross this method:AppDomain.CurrentDomain.SetData()The first paramaeter is the name of the domain property we want to change, and the second is the value.I have this line in my application as the first line of code to be called#If DEBUG Then AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "c:\debug.config")#End Ifyou can also retreive the data using this:appDomain.CurrentDomain.GetData("APP_CONFIG_FILE")for a list of...

Exceptions are a good thing (well custom ones at least)

I have been playing with FxCop for the past 4 months and I just love it. For those of you who don't know FxCop is a code analysis tool that spots violations of coding standards, i.e. casing of methods, parameters,etc. but it also makes recomendations like when to convert a method to a property, when to make a method static / shared, unused methods / fields, and a whole host of other things. You can get it from www.gotdotnet.com.This program recommends that any public method that takes an object be checked to see if the obejct is null and throw an exception if it is.public sub DoTask(addy as...

Interesting article

    http://blogs.msdn.com/oldnewthing/archive/2006/05/09/593605.aspx

Refactoring an Enterprise Application

I am in the process of refactoring a fair sized com application that is consumed by many other applications. When the system was designed all data between the com system and the clients was via a dataset interface. This has caused lots of issues with naming, required fields, etc. so here is my plan to refactor it out while still preserving client compatability1. As I do work create objects that are representitive of the entities being passed in2. Create transformer objects that change the method from a dataset to an object and back again (testing this thoroughly of course)3. Change the Data layer to use these new...

TDD w/ JP

Normally I don't post about life stuff but this is code related. Last night I went to the first edmonton .NET user group meeting and had a great time. Jean-Paul Boodhoo was the presenter and did a great talk about test driven development amongst other things.I have read about TDD and all sorts of patterns books but found them hard to know when to apply them in the real world. JP's presentation was a begging to middle (we ran out of time unfortunately) coding sesssion using TDD to build an application. The cool thing was that we built the application from the presentation tier down pretending that other...