Anurag Agarwal 4f9ee0189c Resolves checkstyle errors for converter, cqrs (#1063)
* Reduces checkstyle errors in converter

* Reduces checkstyle errors in cqrs
2019-11-10 18:39:27 +02:00
..
2018-08-20 21:14:16 +08:00
2019-10-12 20:05:54 +03:00
2017-12-25 11:30:24 +02:00

layout, title, folder, permalink, categories, tags
layout title folder permalink categories tags
pattern Converter converter /patterns/converter/ Business Tier
Java
Difficulty-Beginner

Intent

The purpose of the Converter Pattern is to provide a generic, common way of bidirectional conversion between corresponding types, allowing a clean implementation in which the types do not need to be aware of each other. Moreover, the Converter Pattern introduces bidirectional collection mapping, reducing a boilerplate code to minimum.

alt text

Applicability

Use the Converter Pattern in the following situations:

  • When you have types that logically correspond which other and you need to convert entities between them
  • When you want to provide different ways of types conversions depending on a context
  • Whenever you introduce a DTO (Data transfer object), you will probably need to convert it into the domain equivalence

Credits