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 Wed, 20 Jul 2005 15:06:54 GMT
Not particularly.  To learn to filter a list of beans with JXPath, all I would have to learn
is XPath syntax, which isn't very difficult.  Functors seem much more complicated: creating
predicates and closures, etc.  Functors seem more OO to me, but JXPath seems more quick and
dirty.  I don't know which one performs better, but, like I said above, functors seem more
OO and reusable - you can combine predicates using AND or OR for some pretty comprehensive
filtering.  JXPath seems more quick and dirty.

But I'd like to hear other people's opinions on the subject.  When do you use JXPath?  When
do you use functors?  Why?

-Shawn

-----Original Message-----
From: robertburrelldonkin@blueyonder.co.uk
[mailto:robertburrelldonkin@blueyonder.co.uk]
Sent: Wednesday, July 20, 2005 11:03 AM
To: Jakarta Commons Users List
Subject: RE: [Commons, Collections, JXPath] Looking for more to read,
pros/cons of filtering methods


> 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?
>
> I'm not sure how much more specific I can be.  I don't have a specific
> filtering need that I need solved.  If I have a list of beans, and I want
> to filter them for, let's say it's a list of PersonBeans, hair color,
> where hairColor is an attribute of the PersonBean.  What are the
> advantages/disadvantages of using JXPath as opposed to functors?
>
> Is that more specific?  Does that help?

jxpath is more expressive and requires no coding but requires more
learning. the bean functors in beanutils are somewhere between the two
extremes.

is that good enough?

- robert


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