So all this would be *within* the doCheckout() function?
I guess this gets to the heart of my struggle... When I'm inside the
doCheckout function, am I working on the session.user? Or a reference to it?
Or a snapshot of it?

Basically, am I doing the right thing in passing the whole session.user into
the doCheckout() function? (There's nothing in the session.user which
doCheckout doesn't need to know about...)

[My next question will probably be about locking again! I'm worried my
doCheckout() will take ages because it has a bunch of database calls and a
rather slow web service call to do before it will return anything...]

Many thanks,
Geoff

Ps. I've changed my checkout.cfc so that doCheckout() accepts an argument of
type "user"

<cfcomponent displayName="Checkout" output="false" hint="Checkout CFC">

  <cffunction name="doCheckout" access="public" returntype="struct">
    <cfargument name="referencetouser" type="user" required="yes"/>
    <cfset var shippingid=""/>
    <cfset var billingsuccess="">
    <cfset
shippingid=insertAddressIntoDatabase(referencetouser.getAddress())>
    <!--- Do various other things, including billing the card --->
    <cfset
billingsuccess=SomeFunctionWhichMayTakeAgesToComplete(referencetouser.getCar
dDetais())>
    <cfreturn SomeStructWithOrderDetails />
  </cffunction>

  <cffunction name="insertAddressIntoDatabase" access="private"
returntype="numeric">
    <cfargument name="address" type="struct" required="yes"/>
    <cfset var shippingid="">
    <!--- Stick address in db, return id --->
    <cfreturn shippingid/>
  </cffunction>
</cfcomponent>



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


You are subscribed to cfcdev. To unsubscribe, please follow the instructions at 
http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]

Reply via email to