[Swift] POP - Retroactive Modeling

Jay Lee
May 1, 2022

So you write some classes and structures as we cool developers do.

And later, you need another class similar to the class you have written 3 month ago.

Retroactive Modeling, a dope technique available with Protocol Oriented Programming, is what you can use on that case, reusing written codes with additional features.

Let’s say, the president Joe Biden is in thanksgiving event and a turkey is on the table.

And then suddenly turkey on the table tries to flee and the president to catch it by himself because he was so hungry and we wanna know whether he’s gonna catch it or not.

So we make the both classes conform to the protocol Speedometer

And then finally we would be able to know he’s gonna catch or not.

--

--