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

Welcome to the OOP pattern matching: Visitor Pattern

by Luca Piccinelli5mAugust 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.

Coin Mentioned

Mention Thumbnail
featured image - Welcome to the OOP pattern matching: Visitor Pattern
Luca Piccinelli HackerNoon profile picture
Luca Piccinelli

Luca Piccinelli

@Pcc

I am a programmer. I love programming. Any language, any paradigm

About @Pcc
LEARN MORE ABOUT @PCC'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Luca Piccinelli HackerNoon profile picture
Luca Piccinelli@Pcc
I am a programmer. I love programming. Any language, any paradigm

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