January 24, 2003

OOD (The D Stands for “Dead In The Water”)

Here. In which I come to a startling conclusion on why OO databases never really happened and never will.
January 24, 2003 .net

ASP.NET: Tips and Tricks

Here. From Ben Kohn: See demonstrations of a variety of useful techniques and approaches that can be leveraged to help build powerful ASP.NET Web applications and Web Services. Learn about: debugging, tracing, event logging, performance counters, error handling, Web form session state, sending email from, file upload and others.
January 24, 2003 spout

OOD (The D Stands for “Dead In The Water”)

Reading a very interesting book which I’ll discuss in a future post, I came to a startling conclusion. As much as I love OO thinking and programming, OO databases are never going to fly. I realize that this may not be so startling considering how long OOD products have existed and how unsuccessful they’ve been so far, but the conclusion I came to was *why* they’ll never fly. The reason is simple: the data itself is more valuable than the programs that use it.

For an OO guy, taught that behavior was everything and data was an implementation technique, that’s a startling conclusion. However, the beauty of a database is that it’s devoid of behavior, or, if there is behavior, it’s layered in on top of the data. Programming languages come and go along with the ideas that underlie them and the applications that are built with them. Relational data, on the other hand, is a model that’s simple enough, but complete enough, to move forward from application to application, accumulating value as you go in the data itself. And, since the relational model is so entrenched, no technology for the last 10 years or the next 1000 would be complete without support for it. Even Microsoft, IBM, GM and AT&T will prove to be less enduring than relational data, the tools to program against it and the tools to slice and dice it w/o programming anything (the latter are amazing strong already and continue to grow).

Data in OO databases, on the other hand, are bound to behavior and worthless for anything but the limited set of applications for whom the behavior was paramount and the data an implementation detail. When things change, as they always do, how are you going to get the data out so you can do things different? You’re going to dump it to the simplest, most complete, most firmly entrenched data format that the world has every known — relational data.

OO persistence formats are, by their natural, tied to a specific object model and therefore hopelessly proprietary. And with the emergence of XML, OO persistence formats are going the way of the dodo, even for applications running on machines without a database server. Why would I persist data to a closed format when I can choose relational data for the big stuff and XML for the small stuff? Both provide endless tools for slicing and dicing and bringing forward when the application dies. With OO persistence, when the app goes, so goes the data. The problem with OOD is that things are *too* seamlessly integrated. Ironic, no?

January 23, 2003

Sealed Sucks

Here. Classes should *never* be marked as "sealed" because it ruins the entire model of type compatibility in exchange for dubious protections. .NET has already taken away my determininistic finalization. Must it also take away my ability to derive?
January 23, 2003 spout

Sealed Sucks

I’ve come to the conclusion that the use of the sealed” keyword in C# (and the concept in .NET) should almost never be used, at least on a class. Semantically, sealed applied to a class means that a class cannot be used as a base class. For example, the ImageList class from the System.Windows.Forms namespace is sealed:

public sealed class System.Windows.Forms.ImageList : … { … }

What sealed means is that the designers of the ImageList class didn’t take the time to test what would happen in all the scenarios where an ImageList is specified but a subclass is provided, e.g. MyImageListEx2. So, since they didn’t test these scenarios, they’re protecting developers from deriving from the ImageList base class when bad things might happen. They’re also protecting developers if the base class changes radically in the future and derived classes no longer work.

Stop it!

I don’t want to be protected in this way! Instead, I want to try to derive from ImageList and see if it works in the scenarios in which I’m interested. And if future versions of the ImageList base class break my derived class, I want to update my derived class in ways that work across versions of the base class or have two versions or whatever else I need to do to make it work. By making a class sealed, I just don’t have any choice in the matter, which severely limits me in what I can do.

As an example, I think that the current ImageList implementation sucks in the following ways:

  • Every time you need to edit an image, you need to remove the old image and add it back again
  • Images are too small to see what they are
  • Can’t tag images with names

So, I’d like to build my own ImageList implementation that has the exact same programmatic interface, but that pulls images from manifest resources, fixing most of the issues above. All of the controls that take images get them from an ImageList type, so I need to provide my extra functionality in a type that’s compatible with ImageList. However, the only way to do that in .NET is via inheritance and the damn sealed attribute disables my ability to do that! Instead, I have to build a custom component that’s also an extender provider if I want to provide the same design-time usage as an ImageList and I have to tell developers using my image list component not to use any of the ImageList-related properties because it will conflict with mine. I literally can’t package my functionality in a way that’s developer-friendly in the same way as the ImageList and it’s all because it’s *sealed*!

Of course, the ImageList class isn’t the only one. I had a solution to the problem of asynchronous method calls to web services from WinForms apps the other day (the problem is that an extra hop is always required to get back to the UI thread), but my solution can’t work because the base delegate type required to make an asynch call is sealed. And the list goes on and on of things that I can’t do because somebody is protected” me from potential bad things.

Please, please, please, please, please don’t mark your classes sealed. If you do, folks that want to provide extended functionality, and test to make sure that it works the way it’s supposed to, don’t even have the option. Type compatibility is a huge deal when you’re dealing with class-based abstractions instead of interface-based abstractions and using the sealed keyword throws all of that away. The C++ community survived very nicely without sealed for a decade and it’s made half of the classes on my site possible.

You took away my deterministic finalization. Must you also take away my ability to derive?

January 22, 2003 .net

Free VS.NET Trial DVD

Here. If you haven't done .NET yet because your company hasn't upgraded to VS.NET or you don't want to spend the money if you're not going to like it, you can get a 60-day eval copy on this link in exchange for giving up some personal details.
January 22, 2003 .net

CodeSmith Integrated into VS.NET

Here. Eric Smith has integrated his CodeSmith code-generation tool directly into VS.NET. Very nice.
January 22, 2003 tools

NUnitASP

Here. From Colin: NUnitAsp is a tool for automatically testing ASP.NET web pages. It's an extension to NUnit, a tool for test-driven development in .NET.

← Newer Entries Older Entries →