Last week I was developing a Windows Forms (WinForms) application that required a particular kind of user interface. The application was a step-by-step wizard that had navigation buttons: "back" and "next". Think multiple steps of a setup installer. Each page occupied the same position and contains other controls.
I wanted a more elegant solution other than hiding/showing and moving panels around the form.
Every programming textbook and wiki is going to have a definition for polymorphism, so you don't need me to explain the concept. In my mind, polymorphism is the OOP technique of defining one interface that allows different entities to do the work. In this post I'm going to provide a practical example of subtype polymorphism or subtyping.
This time I'm going to show multi-threading using Tasks, also known as async/await. The two patterns are practically identical and I've kept the structure of the code the same to highlight the comparison.