Showing posts with label ramblings. Show all posts
Showing posts with label ramblings. Show all posts

Friday, July 6, 2007

Refactoring without Starting Over

Image taken from the article
Today I published a short article that I have been working on for a short period of time. It is being reviewed at Code Project and you may find the article using this link: Refactoring without Starting Over.


In the article I introduce a method of adding new features to your code base without having to refactor the majority of the existing code. The method makes use of the adapter design pattern and facade design pattern.


Read the article and let me know if you found it useful.

Friday, February 23, 2007

Yes, sir, I am certainly certifiable

Being a moden software developer means that one is periodically faced with the cruical facts of not having executed any of the planned post graduation examns. Following yet another follow-up meeting with my nearest manager I decided to work on becoming a Microsoft Certified Programmer; and voila today I took the test in 90 minutes (guestimated to take 180 minutes) and received a printed copy which states that I passed.

And what's the point of this rant? Well, I don't know; I guess I'm just in a good mood. My total incubation time from starting the prepation of the test till the final day was 5 working days with a total of 2 hours of study per day. The study consisted mainly of a Transcender test-cd (which is far more recommendable than those printed study guides out there!).

After the test I drove a colleague home and started a journey in the snow. A trip that normally takes ~40 minutes took my 150 minutes today -- all because of bad drivers (or the unexpected amounts of snow). When I got home I filmed this short clip with my cell phone:



Over and out,
Rasmus Kaae, Msc C.S. + MCP!

Wednesday, January 31, 2007

How to generate a problem

Whenever an interface is described as being generic and platform independant one should never blindly trust it. This is a short story of why ...

Some time ago I was involved in a project concerning constructing and deploying a simple .NET webservice interface to a core library that we develop in house. The need for the webservice interface was introduced by a very large international customer, so there was no way around it. Well, actually the customer just wanted a way to access the library from a server running a non-supported operating system. Where "non-supported operating system" should be read as an operating system that once was supported and now is so old that our product managers decided to cut the line. Doing so has an immediate impact on the amount maintaince :-)

So, this webservice was designated to convert back and forth between two military media, which shall remain nameless for no obvious reason. We, the developers, chose to implement the required feature as a webservice in .NET facilitating the SOAP standard protocol. Using standard tools and protocols should guarantee that the customer was able to interface the webservice seamlessly.

After releasing our product including the webservice a customer reported an issue concerning non-US characters in the data. When the customer invokes the webservice with data containing non-US character data the customers application fails to read the output of the webservice call. Such an inquiry is normally regarded as user fault, indicating that the bug was at their end. However, due to the importance of the customer we started debugging the issue. After several hours of debugging strange runtime environments I concluded that the fault was partly the customers issue (and partly our own). The issue was caused by the nature of the data transmitted which was in local code page of the system (which was a requirement). However, transmitting code page data over a UTF-8 encoded medium is not a clever move, seeing that non-US characters are represented as a multi byte encoding in UTF-8 and a single byte representation in local code page.

Our soloution was the base-64 encode the transmitted data, this prevents any mangling and incompatible data in the UTF-8 encoded SOAP XML Envelope. This fixes the problem and everything is jolly good - or is it?

Of course not, the data also needed to be encoded on the user end. As it turns out using different Java SOAP integration kits have different results. Some encodes the string flawlessly and lets the communication between the user application and our webservice work correct, while other kits fails to encode properly and thus provoke our webservice.

Another unforseen event was that the user application was written in Java, which uses 16-bit string representation. This is not a problem, however it is a problem when the developer at the customer end believes that UNICODE is the same be it UTF-7, UTF-8, UTF-16, etc.

So what was the morale of todays story? Never trust that anyone else knows what you are doing. If you need to publish an interface, make sure it is well documented.

Tuesday, January 30, 2007

All hail to blogger

Hello world of blogging

Today is the first day of my life as a blogger on blogspot.com. I have tried to migrate any english texts that I have written to this wonderful place.

So who am I? I am a fairly young male programmer, currently working for Systematic Software Engineering A/S in Denmark. In summer 2005 me and my group mates from Aalborg University graduated as Master of Computer Science or cand. scient. dat. if you like latin abbrevations. My passion for computers and programming has so far lasted for more than 15 years and has taken up dosens of hours of precious sleep. I'm a great fan of STL and boost and enjoy pointing out bugs in foreign code and propose soloutions using either of the above.

Besides my professional hobby as a programmer, I also enjoy equestrian in shape of both dressage and show jumping. Together with my wife, and my parents, I have around 7 horses in stock (quantity varies with time).

I occasionally like to write stuff and publish them on minor sites. Below is a short list of the more important ones (especially notice the multitude of chinese translations on the game article)