Caching Smart Client Lookup Data

G

Guest

Hi,

We're currently developing a smart client application. It is a WinForms UI
that uses WebServices to retrieve data from an Oracle database. The
application will have several forms that will use a relatively static set of
tables for populating drop-down lists. I'm thinking that caching the data
from these tables on the client side, as opposed to bringing them through the
Webservice every time would improve application performance to some degree.
I'm just wondering if the Caching Application Block is the best route to take
for caching static data or is there another recommended approach. The
application itself will not be set up to run offline, so I only need limited
caching capabilities.

Thanks
 
K

Kevin

If you really want a very simple solution, just use a global HashTable
to store things.

When the application first loads, download the necessary information
from the Database and store it in the HashTable. Then retrieve the
information from the HashTable throughout the rest of the life of the
application.
 
L

Luke Zhang [MSFT]

Hello,

The Caching Application Block is suitable if you encounter any of the
following situations:

1. We must repeatedly access static data and data that rarely changes.
2. Data access is expensive in terms of creation, access, or
transportation.
3. Data must always be available, even when the source, such as a server,
is not available.

Also, The Caching Application Block can help you set the expired time for
cached data and detect if the data is updated. It is not a easier way
compared with a local database or HashTable, especially the first time to
use it. But it is a very flexible solution for a .NET project.

Regards,

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
G

Guest

Thanks guys,

I thought about it some more and I think what I'm doing to do is this:

1. Retrieve the lookup tables as a series of datatables in a single DataSet.

2. Persist the DataSet to disk as XML.

3. Everytime the application loads, it will load the DataSet from disk and
read the datestamp of the file.

4. Once loaded, I will make a call to get any new records from all lookup
tables. The definition of 'new' will be anything with a datestamp beyond the
datestamp of the cache file. This will also return a dataset.

5. Do a merge of new and existing records.

6. Persist back to disk.

I think this is the only caching we're going to need, so I think going this
route will be less overhead than implementing the caching block and meet our
needs. Anyone see any risks in using this approach?

Thanks for your advice.
 
L

Luke Zhang [MSFT]

This looks a simple and nice solution. I didn't see any risk about it. (You
may need additional code to manager timstamp field in database. Anyway, it
is not a big deal).

Regards,

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top