• Post Reply Bookmark Topic Watch Topic
  • New Topic

Looking for speed from a list object with JAXB  RSS feed

 
Paul Duer
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have the following code to pull an object from a list inside a compond object. It's actually a JAXB object, so this object is a child element in my XML document.

My question is this. I have a web application that has like 8 pages. It's constantly pulling this object in each servlet. I have to do the check if the object is there, then pull the object if it's not null.

Is there a better way to do this? How can I elminate those constand IF statements checking to see if the object is there?

 
Greg T Robertson
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From my JAXB experience with very large documents it's not really that slow. However if you are that concerned about it, you may want to see about storing them in the session maybe? And then if it's not in the session use your existing lookup?
 
Paul Duer
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess I was more interested in shortening the amount of code.


But I guess make I am making the rookie mistake, just because it takes a couple lines of code, doesn't mean it's slow!

Seems like all those IFs to check if the object is there would be slow.

I have a wrapper object, my XML has a BORROWERS element. I always want to pull the main or co borrower, so I have a convience method that returns the object when you call for it.

Do I need a method that doesn't return it? Like a isXXX method? Or is it just as quick once I have already looked it up in the object.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!