commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Munz" <mm...@apelon.com>
Subject RE: [functor] Uses for Functors
Date Tue, 23 Sep 2003 01:59:05 GMT
Stephen,

  Thanks.  I imagine that, at the moment, the use of functors in Java is probably limited
for the most part to those implementing other languages in Java (Jython, SISC).  At this point
I have a stub of the adapter I mentioned and it seems to work.  When I have it in a presentable
state, I'll pass along my results.

  - Matt


-----Original Message-----
From:	Stephen Colebourne [mailto:scolebourne@btopenworld.com]
Sent:	Mon 9/22/2003 7:17 PM
To:	Jakarta Commons Developers List
Cc:	
Subject:	Re: [functor] Uses for Functors
[functor] is not a package I'm really involved in, but.....

AFAIN, no one is using them in the rest of Jakarta. They probably could,
similarly they probably could be used for event mechanisms. I just don't
know of any cases.

There was some talk a while back of using functors for reflection
(predicates to match the right methods). [clazz] may have this, but I don't
think it does.

So, anything you do is probably new ground. I'm sure the list would welcome
feedback on what you find.
Stephen

----- Original Message -----
From: "Matt Munz" <mmunz@apelon.com>
Stephen,

  Thanks.  I think that the usefulness of functors re: collections is clear
to me.  I'm really interested in other applications, such as event
mechanisms, and in reflection-based invocation (and interception).  Do you
know of anyone using functors for these purposes?

  For instance, are the server folks at apache using them?

  Also, do you know of any other forums for discussing functors in java?

  - Matt

-----Original Message-----
From: Stephen Colebourne [mailto:scolebourne@btopenworld.com]
Sent: Mon 9/22/2003 4:52 PM
To: Jakarta Commons Developers List
Cc:
Subject: Re: [functor] Uses for Functors
[functors] grew partially from the four functors in [collections],
Predicate, Closure, Factory and Transformer. (Although you can argue whether
these are true functors...)

Thus you could look at [collections] to see how these classes are used
there.

Stephen

----- Original Message -----
From: "Matt Munz" <mmunz@apelon.com>
  After reading "Blocks in Java", I'm pretty sure that Functors/closures are
useful in certain instances.  I'm unfamiliar with the topic, however, and
would like to gain a sense of in what scenarios they are best used.  In the
use of collections / iterators, and in the serialization of algorithms
(command pattern), the applicaton of Functors seems clear to me. Are there
other common application areas?

  For example, what about event mechanisms?  Some languages use method
pointers for this purpose.  Is there any sense in using Functors as event
listeners?  I'm considering making a sort of universal adapter that would
adapt a given functor to any of the event listener interfaces.  Does this
make sense?  Has anyone tried using (java) Functors in an event-based system
(GUI)?

  Additionally, what about combining Functors with reflection?  To invoke a
method using reflection, one needs the object to act on and the name of the
method to invoke.  This state can be stored in a proxy object, but perhaps a
Functor / closure is a good choice for this?  Doing so would allow any
object to be adapted to a (set of) Functor(s) at Runtime.  Similarly,
interception, logging, etc., could be provided by a chain of Functors.

  I hope my questions aren't too newbieish ;)  Thanks for creating an
interesting project.

  BTW, I origionally sent this message to commons-user, but got no response.

  - Matt Munz
    mmunz@apelon.com

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org









----------------------------------------------------------------------------
----


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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org





Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message