[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: For Discussion - Web App Searchs



Is the data in list pretty much static or transient?  Do you not care about
showing stale data if you cache it one way or other?


-----Original Message-----
From: Jones, Ashley C [mailto:Ashley.Jones@bellsouth.com]
Sent: Thursday, October 09, 2003 3:16 PM
To: Ajug Members (E-mail 2)
Subject: 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
build applications.

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
I'm working
on moving in that direction.

My current pattern is build a SearchBean which has a primary purpose of
receiving
the properties from a form.  Determining which properties are to be
searched.  Building
a query.  Connecting to the database.  Querying the database.  Taking the
data and
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
the database.

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
memory problems.

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

Thanks
Ashley Jones


*****
"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
computers.60"