> I have run into a nasty mess.
> I need to consolidate various product catalogs, with
> multiple fields of
> information from each, file attachments, images, etc. from
> multiple
> sub-companies into a single CFMX application. I have
> designed the
> Components layer, and the presentation layer can be
> developed by any of our
> developers to suit their specific needs. The data storage
> is the real mess.
> I don't want to create dozens of tables to store all the
> relevant data
> (management nightmare) and I don't want a few smaller
> tables with many empty
> (null) fields (bad design). XML was a thought, but the
> number of products
> is in the tens of thousands, and looping XML with a file
> that large is slow.
> Any thoughts, suggestions, lessons learned.
> Appreciation in advance
Go ahead and use xml and persist your product data in application memory...
so... pseudocode would look like this:
<cffunction name="getprodinfo">
<cfargument name="produuid" type="string" required="true">
<cfset var rs = 0>
<cfset var mypacket = 0>
<cfparam name="application.prodcache" type="structure" default="#structnew()#">
<cfif not structkeyexists(application.prodcache,produuid)>
<cfquery name="rs" datasource="mydsn">
SELECT * FROM products WHERE produuid =
<cfqueryparam value="#produuid#" cfsqltype="cf_sql_varchar">
</cfquery>
<cfwddx action="wddx2cfml" input="#rs.xml#" output="mypacket">
<cfset application.parodcache[produuid] = mypacket>
</cfif>
<cfreturn application.prodcache[produuid]>
</cffunction>
When you update the product info for a given product, remember to delete the data from
the application cache. Trust me, it works. Although you'll probably want to use the
xml functions in mx rather than cfwddx.
s. isaac dealey 972-490-6624
new epoch http://www.turnkey.to
lead architect, tapestry cms http://products.turnkey.to
tapestry api is opensource http://www.turnkey.to/tapi
certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To unsubscribe:
Send UNSUBSCRIBE to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org