JavaWorld
addict
Reged: 06/20/03
Posts: 482
|
|
Java object queries using JXPath
|
tim_b123
stranger
Reged: 03/21/07
Posts: 1
|
|
Using JXPath to query complex data structures fairly simple at compile time.
However, are there any performance comparisons between programatically interogating a data structure with the usual getters/setters and using JXPath though?
|
YannR
Unregistered
|
|
Nice idea. An alternative would be to use the JSTL notation !
|
Unregistered
|
|
There does appear to be a reasonable user guide on the Commons JXPath web site here
|
Hermanussen
Unregistered
|
|
Nice article. Of course, other efforts to achieve similar object query functionality have been made.
XPath is definately a good fit here. But personally, just because of the ease of use, I would prefer JoSQL.
Because SQL is so easy
|
Bart_van_Riel
stranger
Reged: 03/24/07
Posts: 3
|
|
Hi,
I haven't found any noticable performance impact of using JXPath. The major performance hit in traversing object trees is usually in not iterating over them efficiently. JXPath optimizes this.
Grtz, Bart.
|
Bart_van_Riel
stranger
Reged: 03/24/07
Posts: 3
|
|
You can actually combine JXPath and JEXL (which implements JSTL expression language). Use JXPath for getting objects and JEXL for retrieving values from them.
|
Unregistered
|
|
I just looked at JoSQL and it looks like a really neat tool. I'm comfortable with sql and this tool seems to fit nicely. Thanks for the posting.
|
Unregistered
|
|
JXPath is focusing on Runtime value of Java object, while JoSQL is for design time mostly, I think. For performance, I have done a profiling on JXPath, it is very satisfied.
|
Unregistered
|
|
JXPath is focusing on Runtime value of Java object, while JoSQL is for design time mostly, I think. Also, JXPath supports XPath, while JoSQL supports SQL... For performance, I have done a profiling on JXPath, it is very satisfied.
|
Bart_van_Riel
stranger
Reged: 03/24/07
Posts: 3
|
|
Hi all,
Message from The Writer: Please be invited to check out the full JXPath tutorial on my website! Get it at: JXPath Tutorial Homepage
And click my ads to pay the bills!
Thanx, Bart.
|
lenisha
Unregistered
|
|
Well, the performance hit is pretty considerable. For the expression like this iterating couple of lists : "executionItems[@role='S']/priceQuantityAssociations/quantity/value"
Time is 100 times more
For the plain java object 1000 iterations: 1.6 ms For the JXPath compiled expression 1000 iterations: 200 ms
Is there any additional performace optimization available?
Thanks
|