A little confused on how best to pass back rows of data (10+ columns) to client from session bean so that the client does not need to access the remote interface of the entity or session again to access the data attributes. Here's the breakdown:
client calls session Bean remote interface method like:
sessionRemoteInt.getOrderDetail(Cart cart);
client gets back say a vector v with the details. Normally I could do something like:
--begin loop--
v.elementAt(i)getItemName();
v.elementAt(i)getItemNumber();
..more stuff
--end loop--
but I'm going back to the entity bean in this case (either directly from say a jsp page or even a java bean/servlet. How should I do this loop in a session bean and pass it back to the client so I can do get from the client and already have the data stored (in say a vector, array of strings, etc). Any info or snippets of code would be helpful
thanks--
zman
-
passing data from session beans to client/shielding entity acces (3 messages)
- Posted by: Zachary Lendon
- Posted on: May 24 2001 17:52 EDT
Threaded Messages (3)
- passing data from session beans to client/shielding entity acces by Alex Pisarev on May 25 2001 01:53 EDT
- passing data from session beans to client/shielding entity acces by Jonathan Knight on May 25 2001 03:41 EDT
- passing data from session beans to client/shielding entity acces by Alex Pisarev on May 25 2001 07:25 EDT
-
passing data from session beans to client/shielding entity acces[ Go to top ]
- Posted by: Alex Pisarev
- Posted on: May 25 2001 01:53 EDT
- in response to Zachary Lendon
I think that it will be ideal if you use XML here. Return XML document from session bean, SAX parse it in client. -
passing data from session beans to client/shielding entity acces[ Go to top ]
- Posted by: Jonathan Knight
- Posted on: May 25 2001 03:41 EDT
- in response to Zachary Lendon
You could create a ValueObject class to represent the row. The session bean creates these from the data in the entity bean, puts them into some kind of collection and passes them back to the client.
The XML approach would work but why go through the hassle of creating and parsing XML just for the sake of it? I don't want to get into a debate about XML here but a lot of people seem to want to use it every time you pass data about when in some cases it's just overkill. -
passing data from session beans to client/shielding entity acces[ Go to top ]
- Posted by: Alex Pisarev
- Posted on: May 25 2001 07:25 EDT
- in response to Jonathan Knight
This guy is going to output the data from the session bean. He uses JSP/servlets - that means he is going to output in HTML/XHTML/WML. And that means he is going to use templates (if he is not going than I am sorry :) ). Using XSL-T and XML you will get one of the best solutions for output templating. That's why I wrote about XML. In case of Swing client, I would use VO's for sure...