Hey, Nick! Thanks for replying!
You are correct that everthing is local; If I can't restore objects
from a dictionary properly from the Session object, I'll implement
your solution with the twist that on reload I'll create and
repopulate the classes from the array info from the Session object as
you have done, and repopulate the Dictionary with the restored
classes. Kind of like manual serialization.
The original problem that I have was that each "record" that I was
working with has seven different variables, so I'm cleaning up the
code by using a class with seven variables to keep the data for
a "record" encapsulated together in a ASP "class" type.
The original data was stored in seven individual global arrays
(without using classes) with the same design as you proposed: one
index value would be used across the different arrays to "tie" the
data in the seven arrays together to make them one logical "record".
The nasty twist in this code that I'm now supporting has a lot of
differnt types of processing on the data-- in some cases, a query
would execute and return back information that would require, say,
the updating of several variables in, say, six out of ten of
the "records" contained in the seven different global arrays.
Instead of doing a search for a "key" value in one of the arrays and
updating the appropriate (global) variables at a particular array
index, the original author just assumed that the first six "records"
in the arrays would always happen to be the records needing
updating.
This caused data to be very well mixed across the seven different
global variable arrays which were attempting to represent a record.
Due to the number of queries and modification of variables in the
process I'm supporting, it was obvious that I needed to encapsulate
all the "record" data elements together within a class, instead of
spreading the elements around in seven different global variant
arrays. The code is far too difficult to maintain otherwise.
Thanks again for your suggestion-- I'll implement a form of "class
serialization" using the method you described between page reloads.
--- In padnug@xxxxxxxxxxxxxxx, Nick Hebb <nick_hebb@xxxx> wrote:
> I assume that the failedObj.age instead of
> failedObj.nAge was an irrelevant typo since this was
> just an example.
>
> By your example I assume that the classes are defined
> locally in the ASP file (i.e., they're not contained
> in server side components).
>
> If local, are you somehow obligated to use a
> Dictionary? Would storing the class members in
> Session variables suffice, e.g.:
>
[ snip! ]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/dpFolB/TM
--------------------------------------------------------------------~->
|