Re: Composition vs. Inheritance
Seth Gordon <[email protected]> Tue, 27 Feb 2007 08:47:38 -0500
| Newsgroups | gmane.comp.lang.lightweight |
|---|---|
| Message-ID | <[email protected]> |
Robbert Haarman wrote: > So, a better solution would have been to implement just the basic > operations (e.g. add) as part of the class definition, and the higher > level operations in terms of the basic ones. That way, it would have > been clear that you need have overridden only add. But what if you have a more efficient way of implementing #addAll than simply iterating through the members of the collection being added?