commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernard, Shawn" <Shawn.Bern...@turner.com>
Subject RE: [Commons, Collections, JXPath] Looking for more to read, pros/cons of filtering methods
Date Thu, 21 Jul 2005 20:27:06 GMT
Tim, I'd love to see a performance comparison between the two approaches.  Using the two approaches
with examples of differing complexities would be interesting to see.  

-Shawn

-----Original Message-----
From: Tim O'Brien [mailto:tobrien@discursive.com]
Sent: Thursday, July 21, 2005 4:17 PM
To: Jakarta Commons Users List
Subject: Re: [Commons, Collections, JXPath] Looking for more to read,
pros/cons of filtering methods


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


---------------------------------------------------------------------
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