Re: A Design Problem



On Sat, 25 Aug 2007 22:41:55 -0400, Daniel T. wrote:

"Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx> wrote:
Daniel T. wrote:
"Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx> wrote:

Alternative example. When one ant lays a pheromone trail, it
doesn't tell any other ants to do anything, yet laying that trail
is exactly what is needed.

Needed for *what*? Answer this, and you will have the postcondition.

The ant needed nothing. That is why there is no postcondition. The ant
expects nothing, it is simply sending a message, as it was programmed to
do.

You said "laying that trail is exactly what is needed," also "what" and how
"exactly" it "is"? You contradict to yourself. Consider an ant-hill of
genetically modified ants which do not lay trails. Would it survive?

To get back to a programming example. A Subject sends a message to its
Observers when its state changes. Does the Subject do this to cause an
effect? Of course not.

Of course yes. It does this in order to have the message sent. The message
is an object and the messages propagation substrate is an object too. The
postcondition of sending an asynchronous message is at least "the message
is underway." In a more carefully designed system messages have meanings
and the meaning is also a part of the postcondition. Then for synchronous
messages the postcondition also includes "delivered", "understood",
"processed", "replied."

Does the Subject do this to do something in
particular? Of course not.

Again wrong, it notifies about changing its state, which per system design
is interesting to the subscribers. For example, an RT clock sends a message
each 10ms. A mouse sends messages when its button gets pressed etc. And you
cannot send anything without changing the state, either in the physical or
in the software world.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.


Quantcast