Archives

Archives / 2004 / February
  • Do you ever forget the correct format for a connection string? I know I do. Check this site out.

    I always forget how to properly format a connectionstring. Whether it's the correct spelling of the parameters. Or when to declare a provider and when not to. If I need a provider, what's its name. I know. I know I can look it up on msdn or online help or better yet google for it. But there is an easier way. www.connectionstrings.com. It's a simple site that does nothing but, you guessed it, give examples of connectionstrings. It's simple to remember and the answers seem to be correct. At least the ones I am looking for.

  • Using OracleDataReader and OracleConnection (or any .Net connection and reader object).

    It's always important to close connections and readers. Aside from it being sloppy coding not to do so. Failure to do so can prevent the release of connections back to the connection pool. Here is an example of using a reader that using an OracleConnection and OracleDataReader object. I use the “using“ statement to make sure everything is cleaned up. Instead of a “using“ statement you can also use a try/finally, but the syntax of “using“ is just so much cleaner.

  • Getting in front of a crowd again.

    Random Thoughts....It has been a couple of years (back in the Clarus Software Days) since I had to give a presentation to a crowd and yesterday I gave a presentation at the Atlanta .Net User Group Meeting about using custom attribute programming and reflection to implement data validators in the middle tiers. The spirit of the validators is similar to what ASP.Net provides.  It was fun. I hope to do more in the future. Doug Turnure of MS also gave a presentation about Indigo. He does a very nice job presenting to a crowd.

  • Code Generation

    It's official. I am once again excited about code generation. In the past (starting in year 2000), I wrote a product called Template{X}. It used the ASP metaphor to allow you to write ASP like code. But instead of rendering html to a browser, it rendered code to your development environment. http://www.cybral.com/solutions/templatex.htm.

  • How useful are enums?

    I have been reviewing code and designs lately and when you have a discrete set of values that can be grouped together, you should use enumerations. Or does it really matter? Since .Net will allow you to pass in any integer value in place of an enumeration, you must still validate their values by either executing Enum.IsDefined() or some comparison operation (e.g. switch statement) to determine valid values. As Brad Abrams points out in this blog, IsDefined is expensive...and may not work as expected. So a switch statement is the only real way to validate valid values without a performance hit.

  • Enum.IsDefined

    Brad Abrams brought up an interesting point about using Enum.IsDefined. Don't use it unless you have to. It causes the CLR to reflect upon the enumeration. There is nothing necessarily wrong with this, but if you weren't expecting the performance hit...it will be a surprise.

  • How to create a stack overflow

    If you are doing this, Stop. It will cause a stackoverflow everytime ;) Just something I saw in a code review that made me laugh. It was an honest mistake...

  • Why Multiple Inheritance Just Isn't Natural.

    MI just isn’t natural. And I don’t mean the Mission Impossible movies. I mean Multiple Inheritance. Although undertaking a mission to get it included in the .Net framework might make it a worthy title. If we take our cues from nature and evolutionary theory, you can make the parallels to the evolution of the .Net framework. Think about it. Giraffes and Lions don’t intermix. So why should our class definitions of Giraffes and Lions? What would we create anyway? Girions? Liraffes? I say again, it’s just not natural. But what about those rare moments in history when it does happen? You know, such as the time when Zues came down from Mount Olympus to create god/human-like offspring? There are those moments, but they are rare. Furthermore, we don’t know if there are failed attempts between Zues and his concubines. We only hear about the successes...such as Hercules…..But what about those failures? We just don’t hear about them.

  • Outsourcing and the Technology Profession.

    I spoke with an evangelist with Microsoft today and asked him how he saw outsourcing to other countries progressing in our industry. He said Microsoft even outsources to India and China and that they are seeing a great deal of this. He also said that senior architects tend to be the most insulated (but even then you must wonder). This  is something that should obviously concern all of us. Personally, I am a senior architect type person so I have had good luck staying gainfully employed as an independent consultant. But I do worry if this will be the case in 2-5 years. What does everyone else out there think?