[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
For Discussion - Web App Searchs
I'm bored and have what we call the spoc desk this week and can't get any
real work done, so I
thought I might promote a little discussion on different processes we use to
One item I'd love some input into is methods to search a database.
Specifically what other people use and what they conside the best practice.
Currently I primarily design web-apps but not using an app server, though
on moving in that direction.
My current pattern is build a SearchBean which has a primary purpose of
the properties from a form. Determining which properties are to be
a query. Connecting to the database. Querying the database. Taking the
building a list of Data objects. returning the data objects to the servlet.
if list = 0 an error
is thrown, if list = 1, then it object is sent to a view jsp, if list > 1
then the list is forwarded
to a list view jsp where the user can pick one.
Here's where it gets interesting. If you have a list what should you do
with it. As I see it
there are several options.
1) The list is attached to the request object. This causes the list to be
destroyed as soon as
the page is displayed. This is good for memory management, but if the user
does a refresh it will requery
2) The list is attached to the session object. The list can now be
redisplayed without requerying the
database, but you now have to worry about making sure you remove the
object. This can cause
3) I've never done this ( mainly because I just thought of it, b.t.w this
might be a common practise, but I've never
read about it ) but maybe at session creating creating an object to hold
search queries. Any search done by
a user would populate into the object overwriting any previous. This would
help save memory, but you would run
into problems if a user wanted to have up two browsers at once.
any input is welcome
"The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential, proprietary, and/or
privileged material. Any review, retransmission, dissemination or other use
of, or taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all