Version 2

For Momentum, I’m rewriting my document .NET class library. This library has two components, the first is an ADO.net provider for Documentum’s SQL like query language – DQL. The second, is a set of generated strongly types classes that map to Documentum types.

      dt.fields(“object_name”)  = “test”

We can write

dt.object_name  = “test”

I’m rewriting this class library for three reasons. Yes, Joel makes a very good case, that this is something you really shouldn’t do, however there are some good reasons. The first and most persuasive reason is legal. The original version is owned by and my employer, however since there is no intellectual property agreement it’s simply a copyright restriction, and re-coding gets around that.

The second reason has to do with some flaws in the original. The most serious flaw is the decision to build into one assembly both the core data access code and the generated types code. This prevents using the class library with two different schemas, and makes the possibility of distributing the library much more difficult. The second design flaw had to do with the structure of the internal class libraries, because the lowest level of the library makes a bunch of Interop calls to the dmcl.dll, I coded that as a set of static methods – bad idea. This was a mistake for two reasons, the connection info was stored in a higher level class DqlConnection, and this restricted the inner class from knowing, without exception, what the connection was. Normally this wouldn’t be a problem because the connection info was always passed to the static methods, however, in error situations, this became a real problem. The second problem with this separation was that it needs of making the class library thread safe much more difficult. Instead of having 4 critical sections – one for each method that does Interop calls, I need one for each method that makes a call to the Interop class.

The third reason for a rewrite is social - should I decide to release this version for public consumption, I think I’ll have better reception if it’s coded in C# rather than VB.net.

 

1 Comment

Comments have been disabled for this content.