> I store my navigation system as a array of structures coverted to a WDDX
packet.  I don't want to rebuild the packet for each page request, so I'm
thinking about storing the packet in the application, client or session
scope. I have two questions
>
> 1). Is anyone storing WDDX packets in application,client, or session
scope. If so, would you
> please share your experience.
>
I think the general answer to that is.  Why bother?  Application and session
scopes can handle complex data types,  only client variables can't handle
complex data.  If you're accessing the navigation system on every page
request, then if you use WDDX you would have to initially serialise your
data, then de-serialise it for ever page request after that.  Why not just
store it in a session or, if its the same for every user of the application,
in an application variable?

If you decide to use session variables then make sure you think about the
scalability of your application.  ie. if you need more servers in a cluster
then you are restricted as to how you set up that cluster when using session
variables.

If you're using CF5 and lower, then you must remember to do cflocks on all
your reads and writes to shared scope variables.  If you're using CFMX or
bluedragon, then you need not worry about locking, unless you expect a race
condition to occur.


> 2). What is the best way to get a complex data types like an array of
structures of arrays from > the session scope to the request scope.
>
As long as you know the structure of your data you should be able to access
the arrays and structures using bracket and dot notation in the appropriate
order.  Simple example...  I have a query where I know the results will
always contain 7 records and the information from these seven records has to
be displayed in an unusual circular pattern on the screen which isn't easy
to do by accessing the record from 1 through 7, so I just access the field
from the query like this :
#MyQuery.fieldname[1]# for fieldname in my query in the first row or
#MyQuery.secondcol[7]#  for secondcol in My Query in row 7.

Hope that all makes sense and is help to you.

Regards

Stephen




______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to