Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Understanding crux of design patterns

DZone's Guide to

Understanding crux of design patterns

· Java Zone ·
Free Resource

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.

Connect any Java based application to your SaaS data.  Over 100+ Java-based data source connectors.

Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}