This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Re: A&S Footnote (Re: records)
At 6:30 Uhr +0200 26.07.1999, Telford Tendys wrote:
> > In O-O terminology "delagation" normally means inheritance through
> > a chain of "parent" *objects*: A message that is not understood
> > gets passed (delegated) to another object to handle. The point
> > is that there are no classes or types, only objects. Self uses
> > delegation, but neither Java, Smalltalk, CLOS, Simula67, or
> > Eiffel use delagation.
> >
> > Java does *not* use delegation; instead it has multiple
> > interface inheritance combined with single implementation inheritance.
>
> So what is the name for it when an ``awt'' window passes an event on
> to its background window because it can't handle it itself? It seems
> to fit the above definition of delegation.
The name is "Chain of Responsibility", one of the 23 three patterns
from _Design Patterns_ by Gamma/Helm/Johnson/Vlissides. In a CoR an
event is passed on to through a (possibly dynamic) chain of objects
that get at stab at handling it until one of them finally does it.
You may call CoR a case of delegation, but there are people who prefer
a more fine-grained terminology. In their book it is "consultation".
Delegation and consultation are the same in that a method call is
forwarded to another object. They differ, when the target object calls
methods itself: With consultation the methods are called on the target
object itself; with delegation the methods are called on the original
sender object (i.e. the one that forwarded the message).
Michael