Getting into shape
Last week I was teaching a VB.NET class at Interface, and a student in the class took my classic illustration of abstraction and polymorphism to the next level. I always like using ‘shape’ as an abstract example, where ‘draw’ is an abstract method. I ask the question “If you create a ‘shape’ with a ‘draw’ method… what will the shape look like?” Of course, shape is too abstract to know the answer.
When the example reached making shape an Interface, and implementing polymorphism through the draw method, one student decided to make a VB.NET project to prove it all. He not only implemented the IShape Interface into things such as Circle, Triangle, and Square… He implemented IShape in a Cadillac class too! You have to see it to appreciate it.
I wanted to give him credit for pushing his learning experience to another level. His name is Geoff, and here is the download of his project.
Geoff will be reading this weblog, so if you download the project, please come back and provide comments about his creation.