Timothy Khouri - SingingEels.com

I subscribe to the "take it apart and rebuild it" approach to learning.

November 2007 - Posts

New Author - 2 New Articles! (1 Silverlight and 1 AJAX)

I'm always excited to publish new authors on SingingEels.com, especially with fun topics like Silverlight and ASP.NET AJAX. Michael O’Brien, who hails from Dublin, Ireland has contributed the following articles:

Great articles... check them out when you get some spare time.

In Atlanta, GA - Presenting My First .NET 3.5 Project Tomorrow!

We've been using Visual Studio 2008 for a few months now at my job, and now we're launching our first .NET 3.5 web project. It's using a full LINQ (to SQL) backend for all of the data access needs. Other than the LINQ, there aren't many changes from a standard 2.0 web app (membership, profiles, roles, etc).

I have greatly appreciated the language features that come with C# 3.0 and .NET 3.5. Something I recommend you try out for your string validation (which is a must in web apps because everything comes across as strings) is to make a single "Extensions" class and add some extension methods (in C#3 and VB9). Because the application that I've been working on will deal with contractor information, I've had to build the standard "address" validation stuff... IsZipCode, IsPhoneNumber, etc. Here's what the code looks like to make those extension methods:

public static bool IsZipCode(this string input)
{
   // I'm using a simple Regex for my needs.

   return Regex.IsMatch(input, @"^\d{5}$");
}

One of the things I love about extension methods is that you are garunteed to get an instance of the object that you are extended passed in. Meaning, I will NEVER have to check if "input" (the parameter passed in) is null. This is because extension methods add methods on to class instances.

Now, it is true that you could call your "IsZipCode" method and pass in the variable instead of calling "myString.IsZipCode()", but if you do that, then that's your own fault and I hope your code blows up :P)

.NET 3.5 and LINQ in Production

For those of you who are skeptical about .NET 3.5, LINQ, ASP.NET AJAX or WCF - I've been using these in production environments for a while now, and they're beautiful. As soon as things cool off at "work work", I plan on finishing the redesign of Eels using .NET 3.5, WCF (which is in 3.0), ASP.NET AJAX and LINQ. We have already added LINQ keyword highlighting in the article engine as we have had a few articles on LINQ so far.

I'll keep you all posted!

More Posts