Have now started working through a new book - Java Design Pattern Essentials - to practise my Java coding, having gone through the “SCJP 6 Study Guide” book.
Its interesting to see how the concepts and theories I have learnt are actually used.
The book contains a full example for each Design Pattern and its also a good way to learn the Design Patterns and the general theory of design patterns.
The first example I’ve done is Chapter 14 – Chain of Responsibility – which allows more than one object to handle a request. The receiving objects are chained and pass the request along the chain until an object handles it.
The example code includes an interface, an abstract class, several concrete sub-classes and a static method. I also added my own Test14 class, which is used to test it, which it does with a for-each loop, string array and calls to the static method.