Design advice: lists and containment
Jim Menard
jim.menard at gmail.com
Sun Nov 6 17:11:51 UTC 2005
Everyone,
Thank you for the thoughtful advice. In the past, I've usually come
down on the side of "hand out the bookmarks list; trust the caller to
be nice". The thing that tripped me up this time is that I found
myself writing code that had a bookmark, but not the owner of the
bookmark. How, in the bookmark, do I implement behavior like "remove
me from the user's list" for example? I understand now that is the
user's responsibility.
I realize that I asked my question about back-linking before fully
understanding who was responsible for what.
I've applied the Law of Demeter in the past, and it led to
hard-to-follow code: messages end up getting passed through three or
four objects, and then back down to the original object.
Jim
--
Jim Menard, jim.menard at gmail.com, jimm at io.com
http://www.io.com/~jimm
More information about the Squeak-dev
mailing list
|