Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 96402

Pages: 1
JavaWorld
addict


Reged: 06/20/03
Posts: 482
Java object queries using JXPath
      #44711 - 03/20/07 11:30 PM

Java object queries using JXPath

Post Extras: Print Post   Remind Me!   Notify Moderator  
tim_b123
stranger


Reged: 03/21/07
Posts: 1
Re: Java object queries using JXPath [Re: JavaWorld]
      #44757 - 03/22/07 05:51 AM

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?


Post Extras: Print Post   Remind Me!   Notify Moderator  
YannR
Unregistered




Re: Java object queries using JXPath [Re: JavaWorld]
      #44760 - 03/22/07 09:24 AM

Nice idea. An alternative would be to use the JSTL notation !

Post Extras: Print Post   Remind Me!   Notify Moderator  

Unregistered




Re: Java object queries using JXPath [Re: JavaWorld]
      #44787 - 03/22/07 08:30 PM

There does appear to be a reasonable user guide on the Commons JXPath web site here

Post Extras: Print Post   Remind Me!   Notify Moderator  
Hermanussen
Unregistered




Re: Java object queries using JXPath [Re: JavaWorld]
      #44797 - 03/23/07 04:58 AM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
Bart_van_Riel
stranger


Reged: 03/24/07
Posts: 3
Re: Java object queries using JXPath [Re: tim_b123]
      #44830 - 03/24/07 03:07 AM

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.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Bart_van_Riel
stranger


Reged: 03/24/07
Posts: 3
Re: Java object queries using JXPath [Re: YannR]
      #44831 - 03/24/07 03:09 AM

You can actually combine JXPath and JEXL (which implements JSTL expression language). Use JXPath for getting objects and JEXL for retrieving values from them.

Post Extras: Print Post   Remind Me!   Notify Moderator  

Unregistered




Re: Java object queries using JXPath [Re: Hermanussen]
      #44892 - 03/26/07 02:45 AM

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.

Post Extras: Print Post   Remind Me!   Notify Moderator  

Unregistered




Re: Java object queries using JXPath [Re: Hermanussen]
      #45281 - 04/02/07 02:07 PM

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.


Post Extras: Print Post   Remind Me!   Notify Moderator  

Unregistered




Re: Java object queries using JXPath [Re: Hermanussen]
      #45282 - 04/02/07 02:10 PM

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.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Bart_van_Riel
stranger


Reged: 03/24/07
Posts: 3
Fullt JXPath Tutorial NOW available! [Re: Hermanussen]
      #45797 - 04/07/07 03:13 PM

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.


Post Extras: Print Post   Remind Me!   Notify Moderator  
lenisha
Unregistered




Re: Java object queries using JXPath [Re: Hermanussen]
      #49658 - 06/26/07 11:29 AM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 9857

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5