Preface

Life is what happens to you while
you're busy making other plans.
John Lennon

This thesis concludes a "work in progress" that has lasted over a decade – my Master's Degree in Computer Science; finally! I began studying in 1995, but was fortunate enough to get a very nice job within the first two years; a job that I hold and treasure to this day. Combined with life in general, this naturally slowed things down, but almost never to a complete halt, often because of friendly reminders from my family and friends.

Thesis Formally, the workload of the project this thesis represents is 30 ECTS, and it was completed under the supervision of Professor Eric Jul at the University of Copenhagen, Denmark. The work carried out was done from late 2006 to August 2007, and the defence was held on November 2nd, 2007. The presentation delivered at the oral defence is available as [Rode07b]. During this period, many things happened in my life, good and bad. First and foremost, I became a father to a wonderful son named Theodor Rode von Essen; an eye—opener, to say the least, concerning such concepts as time, family, and especially oneself. Unfortunately, my family and I also experienced several deaths in the near family, especially that of my beloved father, Henning Rode, who died only a week before my defence. Secondarily, the company where I work was sold causing quite a few changes in my everyday life. I studied for the Java 5 certification, but never got around to take the exam (wonder why?). My wife and I had our kitchen completely renovated over a strenuous period of almost six months. And then some...! All these things one way or another influenced this thesis, but the reality is also that I at times was not focused enough. I did not manage to state precise and tangible goals for the work to be performed, causing me to pursue and writing about many different areas of interest related to OO and design patterns.

Originally, this project was intended to evaluate different aspects related to the two—way connection between the "Gang of Four" patterns and the programming languages used for implementation. Much work was put into formulating several evaluation criteria in a consistent format, albeit in broad terms. Simplified examples of criteria include how the use of natural language affects the applicability of pattern X in language Y, or vice versa; if the naming of pattern participants is consistent and independent of specific OO programming paradigms; or how easy is it to implement pattern X in language Y? Java 6, and possibly other languages, should act as the catalysts for the evaluations, but the criteria spawned more questions than answers because they were more theoretical than practical in nature. However, the intent had always been to make this a practical project with emphasis on the practical application of design patterns, but the evaluation approach seemed to collide with this. Hence, when I discovered several articles on pattern application utilising specific language features that caused “simpler” implementations, or even pattern componentizations, in various languages, the idea arose to compare such findings with Java 6 implementations of the "Gang of Four" patterns. I also realised that the "Gang of Four" patterns should be evaluated as a whole rather than an arbitrary sub—set because the patterns were published as a complete pattern system with many internal relationships and similarities. The work performed is still an evaluation, but focus thus moved from several forms of evaluation of a handful of the "Gang of Four" patterns to more concise and practical investigation of how Java 6 paradigms can influence the application of all the "Gang of Four" patterns. The final work description for the work performed is approved by Eric Jul and is available as [Rode07a].

Online Version This online HTML version of the thesis is basically a straightforward conversion with only minor changes, such as necessary reformatted and sometimes extended program listings, removed page references, a few extra paragraphs of text here and there, additional links as well as various indexes. The look—and—feel of the thesis is tried adhered to, even though the content really deserves a wiki of some sorts.

Acknowledgements I can honestly say, without a doubt, that I would never have been able to complete my degree, and especially this thesis, without the love and continuous support from my beloved wife, Marina Rode von Essen. Though alien to computer science, she also offered much appreciated assistance with proof—reading and layout. Jonna von Essen also helped with last minute, but very effective, proof—reading.

My workplace - Sirius IT - and colleagues also made this thesis possible as they graciously allowed me to take time off to complete it, thereby burdening themselves with even more work. Several people provided invaluable critique, some of which I unwisely ignored :-). Morten Wolf assisted with harsh, but earnest proof—reading. Jesper Steen Møller provided much appreciated input and Erik W. Rasmussen did as well. Furthermore, Brian Grunnet lent me practically all the books cited in this thesis; some of them have since become mine due to coffee stains and undeniable traces of claws from a cat.

Also, thanks to Henrik Gilvad Nielsen for assisting me with various HTML and CSS tips and tricks for this online version of the thesis.

Finally, I wish to thank Eric Jul for allowing me to undertake a somewhat unorthodox but tangible and hands—on thesis that is actually highly relevant to me. I suspect this is also the case for my co—workers and the likes. Eric's pragmatic approach to this project, even after I changed focus half way through, as well as our many discussions, helped me overcome seemingly overwhelming obstacles to eventually complete this thesis.

Prerequisites The reader is assumed to have an understanding of computer science corresponding to at least graduate level. Familiarity with Object—Orientation and Java is expected, but in—depth knowledge of pattern theory is not required as this thesis presents an introduction to pattern theory and how it relates to OO. However, practical experience with software design patterns and especially the "Gang of Four" design patterns is a definite plus. A sense of humour is not a bad thing either.

Keywords Design Patterns; "Gang of Four"; Java 6; Object—Orientation; Language Features