paint-brush
Welcome to the OOP pattern matching: Visitor Patternby@Pcc
1,463 reads
1,463 reads

Welcome to the OOP pattern matching: Visitor Pattern

by Luca PiccinelliAugust 17th, 2019
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Pattern matching is a founding block of FP software design, and an effective way to address the need of decoupling domain objects data and behaviors. FP is much more expressive than OOP with the Visitor pattern. The original purpose of the pattern was to iterate an operation over collections of heterogeneous objects, that doesn’t share the same interface. In this case, the compiler breaks every concrete visitor, until you implement the new method in each of them. In Kotlin, this is the same as FP pattern matching.
featured image - Welcome to the OOP pattern matching: Visitor Pattern
Luca Piccinelli HackerNoon profile picture
Luca Piccinelli

Luca Piccinelli

@Pcc

L O A D I N G
. . . comments & more!

About Author

Luca Piccinelli HackerNoon profile picture
Luca Piccinelli@Pcc

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite