On 12/11/06, Josh Nathanson <[EMAIL PROTECTED]> wrote:
> I think the idea is that as long as you have sufficient RAM, a call to the
> Application scope will always be quicker than than a call to the CFC. If
> you have a gig of RAM dedicated to CF, a few MB of objects is negligible.
> If your RAM is an issue, it's probably fine to call right to the CFC.
>
> Also Adrian gave a few good reasons to take the objectFactory approach: the
> main one being you are re-using code rather than duplicating code in
> different places.
>
> -- Josh
But there is less code being used with out the objectFactory.
I could have this in my application.cfm
<cfset application.objectOne = CreateObject('component', 'cfc.navigation')>
<cfset application.objectTwo = CreateObject('component', 'cfc.users')>
<cfset application.objectThree = CreateObject('component', 'cfc.email')>
Three lines to load instantiate an object.
Or you could have this in the application.cfm
<cfset application.objectFactory= CreateObject('component',
'cfc.objectFactory')>
<cfset application.objectFactory.register('objectOne')>
<cfset application.objectFactory.register('objectTwo')>
<cfset application.objectFactory.register('objectThree')>
This takes one more line of code in the application.cfm file plus what
ever you have written into your objectFactory.
Now I have the objectFactory in memory that only gets used when I
initialize my app. Plus, I have more code to maintain inside the
objectFactory.
The beauty of ColdFusion is how simple it is to get things done. Why
would I want to go ruin that by jumping on the bandwagon to the
factory? I'm not trying to say that objectFartories are bad. M'kay I'm
just trying to find a way that they would help me.
Phil
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:263636
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4