Re: A Design Problem
- From: "Daniel T." <daniel_t@xxxxxxxxxxxxx>
- Date: Sat, 25 Aug 2007 15:43:05 -0400
"Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx> wrote:
On Sat, 25 Aug 2007 10:05:25 -0400, Daniel T. wrote:
"Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx> wrote:
Of course they may do much more than that if they choose, but the
sender of the message has no right to *expect* them to.
Let's clarify it:
A. If under "sender" we understand "public interface," then M shall
be removed.
What? Sender doesn't mean public interface. "Sender" is an object
sending a message to another.
B. If "sender's expectance" is narrower than that, then the
prostcondition of M might be trivially true in that narrower
context, but still untrue for some other clients. In that case M can
have right to exist. However I would suggest it bad design, because
the sender *expects* the effect of M being visible by other clients.
We obviously disagree.
Example, let we send a radio signal to another galaxy. We cannot
observe the effect of this action, and we will be long dead before
other clients (aliens) will receive it (B). That's a bad design,
mobile phone is much better communication tool. But if (A) there
were no aliens then sending signals would pure wasting time and
money = let's send nothing and say we did.
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.
Uhm, what is semantic difference between "doing" and "being
informed"? I bet there is no one. The postcondition of the
method is "yes sir! Informed, sir!" I suggest that an informed
object differs to an uniformed one. At least it should accept "I
told you so." Otherwise there were really no sense in having
this method.
"When I tell you to do something, I expect you to do it."
Differently to people, computer objects have no freedom of will.
What does that even mean? You are throwing around meaningless phrases as
if they are important in some way.
When object A tells object B to do X, there is an implied
master/slave relationship. When such a relationship exists, B's
responsibility for its own state is reduced.
? I am disagree in so many positions, that I cannot figure out to
where I should start to object:
1. The driving source is neither A nor B, it is the programmer.
2. Object cannot call object. Methods are called. When the method X
belongs to both classes, then roles of A and B are equal.
Neither of the two points above are objections to what I said.
3. B's responsibility for maintaining its state is always 100%.
Otherwise it were not OO.
My point exactly!
.
- Follow-Ups:
- Re: A Design Problem
- From: Dmitry A. Kazakov
- Re: A Design Problem
- References:
- A Design Problem
- From: Mousam
- Re: A Design Problem
- From: H. S. Lahman
- Re: A Design Problem
- From: Nick Keighley
- Re: A Design Problem
- From: Daniel T.
- Re: A Design Problem
- From: Dmitry A. Kazakov
- Re: A Design Problem
- From: Daniel T.
- Re: A Design Problem
- From: Dmitry A. Kazakov
- A Design Problem
- Prev by Date: Re: A Design Problem
- Next by Date: Re: A Design Problem
- Previous by thread: Re: A Design Problem
- Next by thread: Re: A Design Problem
- Index(es):
Relevant Pages
|