commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim O'Brien <tobr...@discursive.com>
Subject Re: [Commons, Collections, JXPath] Looking for more to read, pros/cons of filtering methods
Date Thu, 21 Jul 2005 20:17:25 GMT
Stephen Colebourne wrote:

> Bernard, Shawn wrote:
>
>> For the record, my initial post on this topic had a subject line of:
>>
>>     [Collections, JXPath] advantages/disadvantages
>>
>> My question was:
>>
>>     [W]hat are the advantages/disadvantages of using
>
> > Predicate/Closure's to filter Collections of beans as
> > opposed to using JXPath?
>
> JXPath (or EL/JEXL) is simply a way of getting a piece of data from a 
> complex structure (XML or Bean).
>
> Functors can be used for this purpose too (and might perform slightly 
> faster as the code is real, not interpretted from a parsed string).
>
> However, functors are really intended for deeper problems, 
> specifically actually performing processing. See 
> http://www.onjava.com/pub/a/onjava/2004/12/22/jakarta-gems-1.html?page=last 
> for a good example.
>
...and even that example is very contrived.  Plus, the guy who wrote 
that article is a jerk.  :-)  It is difficult to come up with Functor 
examples that make sense.

An anonymous functor (specifically a Predicate) seems to me to be just 
as straightforward as introducing JXPath.  I think functors are more 
straightforward conceptually, but it is more of a style choice at this 
point.  I'm interested in writing a performance test of both approaches.

Tim



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


Mime
View raw message