
Polymorphism Without Side Effects – Object-Oriented Clarity
We discussed in the previous episode how polymorphic behavior gives us a form of a common language for objects. Thus we need to consider the idea of polymorphism without side effects, so we have clear and concise commands. There is also a consistency required for this to be an approach that is truly useful. What Is Polymorphism Without Side Effects As always, we should start with a definition of terms. In this case, our goal is clarity. Polymorphism is a way to give a command each object responds to. That means there should be similar results for each one. As an example, if I tell several people to “get the mail,” I should be able to assume they either check... Read more