In this project, we perform an evaluation of the "Gang of Four" design patterns from a practical and experimental point of view using Java 6 as the implementation language. We investigate how Java 6 language features affect the application of the "Gang of Four" design patterns, individually and collectively. The investigation focuses on how the practical use of language features can affect the design pattern implementations, not how the features are constructed. To perform a reasonably structured and verifiable evaluation, we define a general evaluation approach on how to evaluate the "Gang of Four" patterns using a language as a catalyst. The premise is to implement all pattern functionality described in Implementation and Sample Code elements in the "Gang of Four" pattern descriptions, as these are the elements that primarily target the practical implementation, and evaluate the outcome.
Using the defined approach, we implement the "Gang of Four" patterns in Java 6 and investigate use of core language features (types, generics, closures, etc.), reflection (class literals, dynamic proxies, annotations, etc.), and special language mechanisms (synchronisation, serialization, cloning, etc.). The individual pattern evaluations show that with a few exceptions, all pattern functionality described in the Implementation and Sample Code elements, including Meta—information, can be implemented or simulated in Java 6 using the investigated features. The comparative evaluation shows that Java’s mixture of static and dynamic features are very well suited to express the "Gang of Four" pattern functionality. Creational and especially Behavioural patterns benefit from dynamic usage, while the static features make the implementations more robust, possibly reusable, and clarify pattern intent. The implementations furthermore provide novel, or at least alternative, approaches on how to implement Abstract Factory, Factory Method, Memento, Observer, Proxy, Singleton, and State in Java 6.