This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
It is quite true that all objects live on the heap and no object is ever really "contained within" another object. However, when we say that one object "has a" instance of another object, we mean that the first object has a reference to the second object. Basically, the second object is a "part" of the first. Let me try explaining with an example.
Let's say that we have this class, My2DPoint:
Now, let's define a new class, MySquare, which "Has a" My2DPoint (in fact, it has two).
In this case, the class MySquare "Has A" My2DPoint in it. Granted, the actual object isn't contained within the instance of MySquare (they're both on the heap), but the My2DPoint object is a part of the MySquare object.
If you say it in a sentence, it seems to make sense:
"A MySquare object HAS A topLeft My2DPoint object and a bottomRight My2DPoint object."
I hope that helps, Corey [ July 29, 2004: Message edited by: Corey McGlone ]