Collections should probably use Functors. The Transformer, Predicate, and Closure interfaces should be migrated over to the Functors project. That's essentially what they are, except that they follow a little different naming conventions. I think they refer to a Closure as a Procedure. Also, Predicate would be UnaryPredicate. Now, I understand that it would be a tremendous problem as far as backward compatibility, but Functors really are a stand-alone concept that can be used across many APIs. Just my $0.02.
----- Original Message ----- From: "Stephen Colebourne" <[EMAIL PROTECTED]> To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> Sent: Monday, September 22, 2003 7:17 PM 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" <[EMAIL PROTECTED]> > 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:[EMAIL PROTECTED] > 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" <[EMAIL PROTECTED]> > 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 > [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > -------------------------------------------------------------------------- -- > ---- > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
