Development

Enterprise Architecture

Monday, February 14th, 2005 | Development | No Comments

I just finished reading Fowler’s Patterns of Enterprise Application Architecture, the last Christmas present I still had to finish. I can’t seem to help feeling that it misses its audience in part with its narratives, depicting different aspects of enterprise programming, and even then all of a sudden go back to text-book descriptions of atomicity in transaction handling for threading. Very odd.

As usual, Fowler notes that he just records the patterns he has witnessed and everyone experienced in enterprise architecture will know these already, and it is rightfully so, so no mark against him there. Now, the Java crowd seems rather enamoured by the OR-mappings and being from that crowd, Fowler recounts those patterns. I am rather ambivalent on its merit, both the book’s and OR-mappings’, so I think I will settle with suggesting this book to newcomers to enterprise development, as a quick introduction to some of the more recurring patterns in the field.

Tags: ,

UrlHistory and Internet Explorer

Wednesday, January 26th, 2005 | Development | No Comments

Back in 1997 I started a humble MFC project to manage my URL history in IE so I could keep track of when I had been to which pages, etc. Like it so frequently happens with spare-time projects, something else came up and it’s been lying in an unsuspecting corner of my harddisk’s sector 27724 collecting dust ever since… well, not literally, I hope.

As I was cleaning out a bit of miscellaneous projects on my disk and trying to work out which projects I wanted to finish sometime, I came across the MFC project and thought… hmm, IE has this stuff in it nowadays, so why not just right write up a wrapper around it for .NET and provide it so tools are a bit easier to write to do custom things. For instance take a snapshot of newly visited pages since yesterday and create a graph of your browsing activity, or what have you of projects one can think of.

Tags:

Chipping away on a program

Tuesday, January 4th, 2005 | Development | No Comments

… or Refactoring: Improving the design of existing code. With refactoring being the buzzword of the day who can afford not to take a gander at the promised land?

Now that may seem like a rather biased introduction, that was indeed what I was going for, however, I have used refactoring for a while, but I have never looked at any literary works on the matter and I thought it was time to pick up Fowler’s book. While it displays a lot of different methods for refactoring I can’t help having the feeling of being talked down to all the way through the book. It is as if Fowler and Beck (who in parts co-authored chapters) have this condescending notion of yeah, yeah, you might have your fancy design model, but this is how software really survives.

While refactoring may provide the means to extend the longevity of your code, I find the picture they paint is overly pink. They are enamoured by their own techniques, fair enough. I guess I just look for more objectivity in books.

All that said then if you are developing object-oriented programs in this day and age you should read the book, if nothing else to see how the refactoring craze started.

Tags: ,

Integrating Source Safe and Mantis

Wednesday, June 16th, 2004 | Development | No Comments

On the never-ending quest for improved development support I have managed to tie Microsoft Visual Source Safe together with the open source bug tracking system, Mantis, so that checkin comments will be reflected in bugnotes in the bug tracking system.

This helps make it easier for developers to see what changes influenced a certain bug, what it took to fix it and so on and so forth, all in all a pretty nifty tool. The first part of the road was etched in clear marble, I’d have to use the VSS 6.0 Automation library using COM Interop from .NET (of course I’m implementing this in C#). Fetching version info is fairly trivial, actually, so kudos to whomever implemented the automation model.

Of course as any developer reading this has come to understand, things just aren’t going to be this easy all the way. So how do we make sure this automation code is triggered when we have a checkin? Well, we make a SourceSafe add-in, right? Sure, if I want to force all developers using it to use the SourceSafe Client rather than do the source control work directly from Visual Studio.NET. So away goes the idea of a SourceSafe add-in. Right, well, a VS.NET add-in must be just what the doctor ordered, right? Well, this is where I, much to my disappointment, wasn’t able to find anyplace inside the VS.NET automation model that allows you to hook up to source control events (please correct me if I am wrong).

So what is a desperate developer trying to please people by integrating their systems to do? Well, how about writing a Windows Service running the integration every 30 minutes, it’s not as if the checkins are that critical to see in real time anyway, is it? An hour later and the entire system is nicely converted to a Windows Service, complete with application configuration bindings that allows you to configure the frequency the integration is run, the MySQL server hosting the mantis tables, the source safe server and user credentials for the same. And as the nice guy I am, here is all the lovely source code for it:

The Service
The Automaton Library

At some point of time I will probably brush this thing up a bit and make sure that it adheres all the technical details of Mantis, and hey, I might even submit it to the Mantis project, although they probably won’t be overly thrilled with seeing Windows-specific code. They are like that them pesky open source people. :o)

Hope you find some use for it. Feel free to drop a line.

Tags: , ,

A DIME for your Country – the continued story

Friday, June 11th, 2004 | .NET, Development | No Comments

I have previously discussed Microsoft’s DIME implementation in their Web Service Enhancements 1.0 library for .NET. Namely the part where they manage to break any and all support for non-ASCII SOAP transfers. It seems as if they’ve rectified this grivious mistake in version 2.0 of WSE, so now we can have international messages, yay!

Of course we have to rebind our solutions, re-test and all, but hey, what don’t we do to get them internation characters delivered to our doorstep?

Tags:

A DIME for your Country

Monday, April 5th, 2004 | .NET, Development | No Comments

Lately at work I have been on a project where we needed to implement a web service client. A part of this client is accepting a series of files passed as DIME attachments. Since .NET doesn’t implement this on its own we had to dig forth the Microsoft WSE 1.0 library, which features a series of extensions to the normal web service programming support.

To understand the full conundrum let us back up a bit. Part of the receival of the documents is an enum with the name of the document type. Since we’re in Denmark and the web service is by another Danish company we do, of course, have some localised names with æ, ø and å in them — e.g. Lånebevilling. Now this is all great as long as we just remember to use utf-8 or iso-8859-1 as the charset type… or is it?

Using the DIME classes is fairly straightforward and not overly difficult so we were taken slightly aback when our web service client notified us that it had caught a Deserialization exception from the SOAP message — namely System.InvalidOperationException: ‘??’ is not a valid value for ResponseType.. With this extremely obvious error message I went spelunking in the badlands of the WSE1.0 implementation. After fruitless hours of looking through the disassembled code of the Microsoft.Web.Services.Dime namespace I sought help with the SOAP 3.0 toolkit and inserted a trace listener to see what actually went across the wire.

After about a days’ work pondering why it just didn’t work I came across an unsuspecting Encoding.ASCII.GetString call in the backlands of the Soap Deserializer. As the client very kindly tells me then å isn’t an ASCII character. Disappointed we were faced with two options: write our own DIME implementation or get our external partner to stop using locale specific characters. Neither a truly pleasing solution.

So to round all of this off then in this case the implementation doesn’t give a DIME about your country or its letters. Just keep to ASCII and everyone will be happy. Pity.

Tags:

XFRE

Tuesday, February 3rd, 2004 | Development | No Comments

From the while we wait department comes XFRE, or XML-XHTML Forms Roundtrip Engine. XFRE provides a simple and crude version of the recent, as of time of writing, W3C recommendation, xforms. Its sole responsibility is to, using xslt, be able to generate a user interface in XHTML Forms based on an XML document and then regenerate this XML document from the user’s input. So until we get a real server-side .NET XForms implementation this will have to make do. Notice the issues and caveats on the project page.

Tags: