I sent the following
note to Vassili Bykov
shortly after his first
blog item
Introducing Announcements, a
replacement system for the
Events system of
VisualWorks.
Thanks for the blog
items on Announcements. As
you know, I am
in favor of reifying
the parts of Smalltalk
that are now not
very object-oriented. (Another
area is that of
protocols.) I
I hope you will also
cover how Announcements
are connected to the
classes that trigger them
(similar to the use
of #constructEventsTriggered for
events) along with any
possibilities of inheritance
and overriding.
A particular requirement of
SmalltalkDoc is to be
able to lists the
announcements defined by
a specific class. For
events, it currently
sends #constructEventsTriggered to
the class and separately
to its superclass, and
then subtracts out the
superclass events. This
works, but separate
#allAnnouncements and #definedAnnouncements
methods would be
better.
These days, Vassili is
busy working on the
latest release of
VisualWorks, so he probably
hasn't had to time
to consider this
further. This has given
me time to think
about the issue I
raised a bit deeper.
SmalltalkDoc, a comprehensive
documentation subsystem Mark
Roberts and I have
been working on (as
resources permit), needs
to be able to
document the list of
Announcements that objects
of ClassX announce.
Why? So that
programmers know what
announcements from ClassX objects
they can subscribe to
and handle -- without
having to pour through
the code of ClassX.
That's why something
like #constructEventsTriggered is
needed for Announcements,
too.
But there is a
deeper reason than just
for documentation. In a
word, it is
reflectivity
, a fundamental property
of Smalltalk , the
ability of programs to
get information about
themselves and work with
it. This is
particularly valuable for the
creation of tools.
For example, suppose
someone wanted to create
tools that help
programmers bridge the gap
between Pollock UI
panes and the objects
of a domain model.
It would be necessary
to tell them about
UI pane announcements.
The Parts subsystem of
the old Visual
Smalltalk product is an
example of this. Who
knows what other tools
could also take
advantage of this information.