Jaaved Ali Khan

33%
Flag icon
We’ll ignore the arithmetic nature of Vectors and focus on how it delegates. Sometimes, clients want to treat a Vector as a Collection of Numbers. When someone iterates over a Vector, it delegates to its “elements” instance variable: Vector>>do: aBlock           elements do: aBlock This is an example of Simple Delegation. You can imagine implementing at:, at:put:, size, etc. the same way.
Jaaved Ali Khan
delegating the messages or method call to the methods of objects referenced by intance variables.
Smalltalk Best Practice Patterns
Rate this book
Clear rating
Open Preview