Dialog warn: equivalent in squeak

Lothar Schenk lothar.schenk at gmx.de
Thu May 29 16:25:30 UTC 2003


Bert Freudenberg wrote:

> Actually, "self inform:" is way better.

Better for what? In which way?

The term 'better' implies that there exists a measure which can be used to
rank two or more candidates in regard to this measure. Whenever I see two
people disagreeing about "what is better", they either don't agree on which
measure to apply and how to apply it, or they never bothered to state what
their measure is in the first place.

> How would creating an explicit dependency to PopUpMenu be better than a
> generic message send to self?

If what I wanted to effect was precisely to have an instance of PopUpMenu
pop up with a message text, then - if _clarity of expression_ were my
measure - there could be nothing better than stating just that.

On the other hand, if I didn't care how the notification took place, as
long as I got my message across, somehow, then saying "PopUpMenu inform:"
would be much too specific, and it would not be a clear expression of my
intent, again.

Now, if _flexibilty_ were my measure (the ability to satisfy the same basic
intent by more than one means), then a polymorphic message is better suited
for that, exactly because it leaves out the specific means of accomplishing
the goal.

Note, however, that you always depend on "some object" to eventually
provide the service you are asking for. If that doesn't happen, your code
doesn't work as intended, anyway. Explicit dependencies are not necessarily 
bad, because they contain the information that a dependency exists and to 
what, and that if you tinker with the other side of the dependency, then 
things might break.

The down side of too much flexibility is that you have a hard time of
tracking your dependencies (necessitating various "clean-up" projects,
sometimes).

> That is as encapsulated as you can get.

So, encapsulation seems to be your measure. How do implicit vs. explicit
dependencies impact encapsulation?

-- Lothar

"Walk this world with me"



More information about the Squeak-dev mailing list