RE: [Commons, Collections, JXPath] Looking for more to read, pros/cons of filtering methods

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

RE: [Commons, Collections, JXPath] Looking for more to read, pros/cons of filtering methods

sabernar
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: [hidden email]
[mailto:[hidden email]]
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: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]