(FYI...we have a singleton "controller" that is decorated with all the services it
needs and stored in application scope)
controller
-- service1=persist1 (all S and P are tight coupled: 1=1)
-- service2=persist2
-- service3=persist3
=======================================
I really can't see many options to get these values down to where they're needed,
other than:
- get the controller to add them to every service method call (yuck!). this will then
be passed ot the persist.
- create specific methods that send the values from controller to service to
persist.the persist stores the values in it's variables scope.
but I can't help thinking there is a neater way to do this.
and if the persist calls to a .config file then that's breaking encapsulation (file
missing, etc)
this is the "create specific methods" idea: (note: the DSN is just an example)
<!--- in the controller.cfc --->
<cffunction name="setDSN" returntype="boolean">
<cfargument name="dsn" type="struct" required="true" />
<cfloop collection="#service#" item="serviceName">
<cfset bOK = service[serviceName].setDSN(arguments.dsn) />
</cfloop>
</cffunction>
<!--- in the service.cfc --->
<cffunction name="setDSN" returntype="boolean">
<cfargument name="dsn" type="struct" required="true" />
<cfset bOK = persist.setDSN(arguments.dsn)>
</cffunction>
<!--- and finally in the persist --->
<cffunction name="setDSN" returntype="boolean">
<cfargument name="dsn" type="struct" required="true" />
<cfset variables._dsn = arguments.dsn />
<cfreturn true />
</cffunction>
--
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
----------------------------------------------------------
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]