The Command Design Pattern in Kotlin

Photo by hannah joshua on Unsplash, ty bro 👊🏾

The Command Design Pattern is a behavioural design pattern, and as such is responsible for making two actors communicate in an efficient and maintainable way.

Problem

Often, an object (the Sender) makes a request to another object (the Receiver). Doing this in a naive way requires the Sender to know who the Receiver is at compilation time; if the Receiver changes, you