Programming

Further Deprecating the Decorator Pattern

Posted on
Design Patterns Book

In the last post, we saw ways to replace the decorator pattern for static use cases. If you want to decorate functional interfaces though, there is another whole class of use cases, in which the decorator pattern may not be the most suitable solution. Scenarios Let us consider a few typical scenarios, where dynamic decorations […]

Programming

Deprecating the Decorator pattern

Posted on
Design Patterns Book

This post explains how modern languages make most usages of the decorator design pattern obsolete. For those of you, who do not know the decorator pattern, a quick recap is given, before I explain why it’s not really a good idea if your language supports multiple inheritance properly. Finally, we will look at those few […]

Programming

Deprecating the Observer pattern

Posted on
Design Patterns Book

Pretty much every developer these days knows about the above book: Design Patterns, by the famous gang of four. Within the book, we find a lot of valuable information including the observer pattern. In this post, I will give a quick review of this pattern, show how it’s directly supported in Java, and why you […]