Arkni / json-to-csv

JSON to CSV converter
Other
54 stars 67 forks source link

Design Patterns #7

Closed gjareval closed 1 year ago

gjareval commented 1 year ago

For educational reasons in this repository identify 2 design patterns that can be applied.

Chain of Responsibility The JSON to CSV conversion job can be modeled through a chain of responsibilities, where each type of conversion will evaluate whether or not it can convert the file.

https://github.com/Arkni/json-to-csv/blob/6057d41ae969bf313478f0d7024fde1cfd6c276a/src/main/java/org/jsontocsv/Main.java#L28-L80

Remaining as follows

image image image image image image

UML class diagram image

Facade Following the previous pattern as a subsystem, the facade pattern can be used to give easy access to the entire chain of handlers. image

Remaining as follows

image

UML class diagram

image