<cfset Application.userFactory = CreateObject(‘component’,’com.framework.user’) />

<cfset Application.userFactory().AddUser(UserObject) />

<cfset Application.userFactory().DeleteUSer(UserObject) />

 

bit confused by this code.

 

1) userFactory is not a function.

2) why is the factory performing CRUD operations? the factory should return an instance of the user component?

 

 

<cfset Application.userFactory = CreateObject(‘component’,’com.framework.userfactory’) />

 

<cfset variables.oUser = application.userFactory.newUser()><!--- return a new instance of the user object --->

<cfset variables.oUser.AddUser(argumentCollection=form) />

<cfset variables.oUser.DeleteUser(User_ID=form.user_id) />

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Andrew Scott
Sent: 27 October 2005 06:49
To: [email protected]
Subject: [CFCDev] Race Conditions when scoped in the Application variable

 

Ok I am looking at a solution where I am keeping track of certain details that users do on the website. I was looking at creating it in the application scope. But I am unclear on a few things.

 

If I set up the scop in this manner.

 

<cfset Application.userFactory = CreateObject(‘component’,’com.framework.user’) />

 

Now through the code I will make reference to it like such.

 

<cfset Application.userFactory().AddUser(UserObject) />

<cfset Application.userFactory().DeleteUSer(UserObject) />

 

Now what I am not clear on is the internals of this, for example. The user object has a structured array that contains the information for all users logged into the system, and other tid bits of information. My question is, should I be locking access to variables when setting inside or not?

 

This is where I am a little unclear, I have had a look at the Mach-II framework and it doesn’t seem to do this. Except when setting the application.userfactory in the application scope to begin with.

 

Could someone give me a little more run down on this, as well as hopefully clear the process up a little more for me as well.

 

 

Regards
Andrew Scott
Analyst Programmer

CMS Transport Systems
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9699 7988  -  Fax: 03 9699 7976


Quote:
A pessimist thinks everybody is as nasty as himself, and hates them for it. - George Bernard Shaw
------------------------------------------------------------------------------------------------------

----------------------------------------------------------
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).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

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).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

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

Reply via email to