avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Nokleberg <ch...@sixlegs.com>
Subject Re: MethodClosure (BCEL Delegator implementation)
Date Mon, 23 Dec 2002 19:26:58 GMT
On Sun, Dec 22, 2002, Leo Sutic wrote:
> The question is now: If you add the same method twice, will it be called twice?
> Excalibur's implementation (and C#) says no. The MultiDelegate has a 
> set-like behavior, so that adding a delegate once is the same as adding it 
> twice. The code above is therefore equal to:

I did some research and C# does allow duplicates. Here's a snippet from
the docs:

    The invocation list of a delegate is an ordered set of delegates in
    which each element of the list invokes exactly one of the methods
    invoked by the delegate. An invocation list can contain duplicate
    methods. During an invocation, a delegate invokes methods in the
    order in which they appear in the invocation list. A delegate
    attempts to invoke every method in its invocation list; duplicates
    are invoked once for each time they appear in the invocation
    list. Delegates are immutable; once created, the invocation list of
    a delegate does not change.

It's easier to implement if you don't require set-like semantics. I'll
get a example multicasting delegate implemented in the next week or so
for people to look at.


To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>

View raw message