What about determining the parent path outside of this component and
passing it in as an argument?

Also, as an aside, you're setting a default of structNew() for
arguments.data, but if that default gets set won't the method fail
because variables.instance.parentID won't exist?

Regards,

Brian


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Phillip Cave
> Sent: Thursday, December 18, 2003 3:46 PM
> To: [EMAIL PROTECTED]
> Subject: [CFCDev] BO methods that require db access
> 
> 
> 
> Besides the DAO and Gateway components, where is the best 
> place to put BO code that needs to access a database. I have 
> a section component that needs to set it's directoryPath 
> property based on it's parentID property:
> 
> <cfcomponent displayname="section" hint="I model a single section.">
>       <cffunction name="init" access="public" 
> returntype="section" output="false">
>               <cfargument name="data" type="struct"
> default="#structNew()#" />                    
>               
>               <cfset variables.instance = arguments.data />
>               <cfset variables.instance.directoryPath =
> getParentPath(variables.instance.parentID) />
>               
>               <cfreturn this />
>               
>       </cffunction>
> ...
> 
> In the above example, where should the getParentPath() method 
> be located. This method would get the parent section's path 
> which is stored in a database.
> 
> Any suggestions?
> 
> Thanks,
> Phillip
> 
> --
> 
> Phillip Cave
> Director, ColdFusion Development
> Macromedia Certified ColdFusion Developer
> Carol/Trevelyan Strategy Group 
> 202.448.5212
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
> in the message of the email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
> 
> An archive of the CFCDev list is available at 
> www.mail-archive.com/[EMAIL PROTECTED]
> 

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

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

Reply via email to