commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <>
Subject Re: [lang] Delegates was Proposal for *NEXT* version
Date Sun, 06 Oct 2002 13:18:57 GMT
Stephen Colebourne wrote:
> Split the thread as this bit got lost...
> There are definite similarities between this Delegate description and the
> code that is currently located in [pattern]. [pattern] contains four simple
> callback interfaces Predicate, Transformer, Command and Factory. It also has
> methods that support calling back to an arbitrary method using reflection.
> Delegates take the approach of allowing any interface and calling back using
> reflection.
> The [pattern] case limits the interfaces to specific ones.
> Otherwise they are similar.
> There is a lot that can be done with delegates/BCEL/advanced beans. I would
> really like to start getting this together, but I think that its a new
> project [clazz] that builds on [lang].
> Stephen

If we can throw together delegates and generic meta-info I would pass out
with joy...  Those two features are becoming necessities in Avalon land.
We are attempting to work with meta-info using component descriptors--but
a more generic approach would be better IMO.

Anyway, what else do you want to include with Delegates?

BTW, the code is in place and works quite well.  The only issue is that
I would like to have a MultiDelegate that returns a Delegate capable
interface return a MultiDelegate.  Example is this:

Agent agent = (Agent) Delegate.newMultiDelegate( Agent.class );

//  Add new listeners:
((MultiDelegate) agent).add( otherAgent1 );
((MultiDelegate) agent).add( otherAgent2 );

// Get the result:
Action action = agent.findAction();

// Use result:

(If you are wondering what that is all about, I am working on putting
together a framework for Intelligent Agents.)


"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message