Join the DZone community and get the full member experience.
Join For Free
Java-based (JDBC) data connectivity to SaaS, NoSQL, and Big Data. Download Now.
Lots of articles and books explain the design patterns as problem, design solution and implementation. These kinds of explanations are very difficult to relate and apply directly to actual use case on which developer is working on. In addition to reading UML diagram and sample code it is very important to understand the idea behind the design pattern. There might be cases when design pattern can be implemented in different manner then shown in the UML diagram or we need certain feature of the pattern and we can avoid implementing complete hierarchy of the pattern, thus reducing the number of classes and complexity of the code. For example in decorator pattern how important it is to have an decorator interface which extends from base object interface (component which needs to be decorated) and then creating concrete decorators extending this decorator interface. If code does not require the polymorphic behaviour linked to decorator interface but can work directly with base object reference, we can avoid one extra interface to be created.
Opinions expressed by DZone contributors are their own.