On Tuesday, Feb 4, 2003, at 07:34 US/Pacific, Andy Ousterhout wrote:
> Taking your example a step farther, lets assume that the determined 
> logic is
> that the method's will automatically save it once a minimum amount of
> correct information is set.  How would you maintain the object's state?
> Through either session or user variables?  Using fields instead of 
> objects,
> one could just used hidden fields to pass the information from page to 
> page.

Just store information in "this" scope (or, if you want to be a bit 
more secure and OO, the unnamed scope). Then store the CFC instance in 
session scope.

If a CFC is saved in a shared scope, its data members exist for as long 
as the instance exists:

        <cfif not structKeyExists(session,"myArticle")>
                <cfset session.myArticle = createObject("component","article")>
                <!--- perhaps initialize session.myArticle variable --->
        </cfif>

        <cfset session.myArticle.setTitle(myTitle)>

        <cfset session.myArticle.setAuthor(myself)>

        <cfset session.myArticle.save()>

Make sense?

Sean A Corfield -- Director, Architecture
Web Technology Group -- Macromedia, Inc.
tel: (415) 252-2287 -- cell: (415) 717-8473
aim/iChat: seancorfield -- http://www.macromedia.com
An Architect's View -- http://www.macromedia.com/go/arch_blog

ColdFusion MX and JRun 4 now available for Mac OS X!
http://www.macromedia.com/go/cfmxosx

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to