Over a million developers have joined DZone.

Understanding crux of design patterns

DZone's Guide to

Understanding crux of design patterns

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

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.

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. 


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}