[squeak-dev] Possible code smell? - Abstract Collection members not overridden

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Sat Mar 27 18:35:56 UTC 2021


Hi all,


just a quick thought while working with some collections: There are a number of non-abstract Collection subclasses that do not override abstract members of Collection, such as #add: or #remove:ifAbsent::


Collection allSubclasses select: [:class |
(class lookupSelector: #add:) = (Collection >> #add:)].
Collection allSubclasses select: [:class |
(class lookupSelector: #remove:ifAbsent:) = (Collection >> #remove:ifAbsent:)].

I.e. for example, RunArray new add: 1 raises a SubclassResponsibility rather than a NotImplemented (#shouldNotImplement) exception. Do you think this is a code smell/erroneous behavior and should be fixed? Or should we just use #shouldNotImplement in Collection >> #add: & Co.?

We might have similar effects in other hierarchies, but I did not check my entire image for them ...


Best,

Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210327/6c3c8c84/attachment.html>


More information about the Squeak-dev mailing list