You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Bernard, Shawn" <Sh...@turner.com> on 2005/12/19 14:20:44 UTC
[Collections] When to use a Predicate?
Under what circumstanes would one use a Predicate to encase conditional logic? I know it's a rather broad question, but I was looking at them and they seem pretty powerful, but I wouldn't want to use them incorrectly.
Thanks,
Shawn
Re: [Collections] When to use a Predicate?
Posted by Stephen Colebourne <sc...@btopenworld.com>.
Bernard, Shawn wrote:
> Under what circumstanes would one use a Predicate to encase conditional logic? I know it's a rather broad question, but I was looking at them and they seem pretty powerful, but I wouldn't want to use them incorrectly.
If you like the functor style of programming then go ahead and use it!
There is a potential downside in terms of extra classes and object
instantiation, but on modern JVMs thats not really a big issue.
Stephen
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org