In general, when you have a session bean that performs a search is it sometimes better to
return object identifiers instead of the entire objects themselves?
I have a search page where a user can enter various criteria to get a search results. Once
the search results are returned, the user can click on a record to go to a detail page. In
most seam examples I have seen, this is done with a session bean that returns a list of
objects and loads them on the search results page and subsequently gets injected into the
detail page when the user selects a row in the search results.
However, in the case of a complex/expensive query does it ever make sense to merely return
a list of object identifiers rather than the objects themselves? What this would mean is
that after the results were returned, and the user selected a record, the object
identifier would be injected into a lookup method on a session bean that would then
retreive the entire object rather than having the object being injected directly from the
search results page. (I hope I am makes sense with this)
(I can supply more code and examples, but I didn't want to get into the nitty gritty
unless I had to. )
I understand that for simple searches returning objects and then injecting the objects
directly into the the detail page would be better, but in the cases of complex queries or
cases where you need to pre fetch a fairly large object graph on the detail page, it makes
sense to me just to return an object identifier rather than the objects themselves. But
I am still quite new at all of this, so I am looking for feedback from more experienced
(or smarter) persons.
Any feedback is appreciated. Thanks.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056677#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...