The Bridge Pattern

The Bridge pattern is a structural design pattern in which abstraction is used to separate the interface from the implementation so that the two can be modified independently. The Bridge pattern is particularly useful when developing code which might need to run on different platforms. For example, suppose you want to develop a user interface … Read more

The Decorator Pattern

The decorator pattern is one of the classic structural patterns. A decorator wraps an existing object and provides additional functionality (decoration) whilst providing the same interface as the original object. One example which comes to mind is from an episode of Flight of the Conchords. Bret tries to ‘upgrade’ an ordinary mobile phone by gluing … Read more

The Builder Pattern

In this post we will discuss the Builder Pattern. This is one of the standard creational design patterns. It is particularly relevant when dealing with complex objects which may be conceptually built up from a set of components. In this pattern, the object is often built up in stages rather than being created immediately in … Read more