|
Hey Sean, Thanks for the info. I read D.Ross's article (good article by the way)
and it seems that my factory is a little bit different than the factories described.
Ross mentions as a limitation of using factories: "what if I have a DAOFactory, which is
responsible for creating/configuring 10 different DAOs, and one day I decide
that the dsn which DAO #7 needs a different dsn than all the others. You are
now going in your factory to add a special case..." My factory is only a list of special cases.
There is a separate create method for every CFC. This is what it looks like: <!--- load ---> <cffunction
name="load" access="public" returntype="any"> <cfargument
name="ObjectName" type="string" required="yes"
/> <cfset
var ObjectInstance="" /> <cfinvoke
method="create#arguments.ObjectName#"
returnVariable="ObjectInstance"
/> <cfreturn
ObjectInstance /> </cffunction> <!--- createPermGW
---> <cffunction
name="createPermGW" access="private"
returntype="PermGW"> <cfset
var Obj=createobject('#this.CFCMapping#.PermGW') .init(this.Database.System,
this.SystemUtils) /> <cfreturn
Object /> </cffunction> <!--- createUser ---> <cffunction
name="createUser" access="private" returntype="User"> <cfset
var Obj=createobject('#this.CFCMapping#.User') .init(load('SystemMSG'),
load('UserDAO')) /> <cfreturn
Object /> </cffunction> What’s the major difference between
that and the Coldspring XML: <!--- createPermGW ---> <bean
id="User" class="CFC.Perm"> <property
name="DSNInfo">
<ref bean="DSNInfo " /> </property> <property
name="SystemUtils">
<ref bean="SystemUtils " /> </property> </bean> <!--- createUser ---> <bean
id="User" class="CFC.User"> <property
name="SystemMSG">
<ref bean="SystemMSG " /> </property> <property
name="UserDAO">
<ref bean="UserDAO " /> </property> </bean> Cheers, Baz -----Original Message----- On 12/17/05, Baz
<[EMAIL PROTECTED]> wrote: > What are the advantages of using
Coldspring over having a central Factory > CFC? Is the factory not an equivalent
counterpart to the Coldspring XML > file? I think Dave Ross answered that question on
this list just the other day - and also posted to his blog: http://d-ross.org/index.cfm?objectid=2EC8FF78-EF49-4E45-CDFEF2DA7F393A25 Does that not answer your question? -- Sean A Corfield -- http://corfield.org/ Got frameworks? "If you're not annoying somebody, you're
not really alive." -- Margaret Atwood ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe,
send an email to [email protected] with the words 'unsubscribe cfcdev' as the
subject of the email. CFCDev is run by CFCZone (www.cfczone.org)
and supported by CFXHosting (www.cfxhosting.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' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected] |
- RE: [CFCDev] Coldspring vs. Factory Baz
- Re: [CFCDev] Coldspring vs. Factory Chris Scott
- Re: [CFCDev] Coldspring vs. Factory Chris Scott
