OOP reorganizes programming into patterns of messages among cooperating objects. This sounds harder than it is, but in some cases it is harder than it sounds! When you have a few objects and a few messages, it’s not too difficult to keep straight who says what to whom passing which arguments. When you have a [...]
The Many Shapes of Polymorphism
What is Polymorphism? The word “polymorphism” is from the Greek words “poly”, which means “many”, and “morph”, which means “form”. So “polymorph” means “many forms”, and “polymorphism” means “the ability to take on many forms”. But enough academics. How Does Polymorphism Work? Polymorphism is a by-product of message-passing, or dynamic dispatching. One message may execute [...]
Encapsulation and Aggregation
Each week I intend to discuss an object-oriented programming concept, often from an unusual perspective. This week I want to talk about encapsulation and aggregation. Subscribe to the Object Mechanics Guild Newsletter using the form to the right, to make sure you are notified when a new article appears, and to download the first book [...]