I've condensed the UnaryPredicate interface here. It provides both a boolean return and a context parameter.
package org.apache.commons.functor; public interface UnaryPredicate { boolean test(Object obj); } Granted the method name doesn't seem to represent the intent of the Command interface. How -----Original Message----- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 7:57 PM To: Struts Developers List Subject: RE: Decomposing RequestProcessor -- Some Code To Play With On Wed, 13 Aug 2003, Tom Drake wrote: > Date: Wed, 13 Aug 2003 16:38:51 -0700 > From: Tom Drake <[EMAIL PROTECTED]> > Reply-To: Struts Developers List <[EMAIL PROTECTED]> > To: 'Struts Developers List' <[EMAIL PROTECTED]> > Subject: RE: Decomposing RequestProcessor -- Some Code To Play With > > Forgive me if this has already been brought up, but > jakarta-commons/sandbox/chain appears to have significant conceptual > overlap with commons/sandbox/functor. (Command := UnaryPredicate) > > Any thoughts about merging these concepts? > > Tom > Functors (at least the way Rodney did them in the functor package) are different in two very significant ways: * They have a return type of void, so you can't use the return value as a flag that the chain has been completed. * They don't pass a context around, so you have to define some other mechanism to gain access to the state information that your command operates on. I didn't like either of those two restrictions, so I don't know how much you could really combine the two approaches. Craig --------------------------------------------------------------------- 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]