I kind of just said this, sorry for the repeated comments, but the major difference is the ColdSpring example is Declarative. I don't want to beat a dead horse here, but defining dependencies, services, aspects, etc, declaratively is a major major point to consider here.


On Dec 19, 2005, at 7:29 AM, Baz wrote:

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-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Sean Corfield
Sent: Sunday, December 18, 2005 5:52 AM
To: [email protected]
Subject: Re: [CFCDev] Coldspring vs. Factory

 

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]

Reply via email to