Kerry,

 

The object in question was an example. However I will be holding a collection of this info hence my question in the first place.

 

 

Regards,

Andrew Scott

 

Quote of the Day:

There is no thought in any mind, but it quickly tends to convert itself into a power. - Ralph Waldo Emerson


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Kerry
Sent: Thursday, 27 October 2005 6:43 PM
To: [email protected]
Subject: RE: [CFCDev] Race Conditions when scoped in the Application variable

 

My main query was really why is the factory performing crud operations.

 

The meaning of this line is to show the factory returning a new instance of the object that does the crud operations so that there is no need for any locking.

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

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

Kerry,

 

First of all I type this in a bit of a hurry, so yeah it userFactory is not a function. Secondly as I described the object is a user object that will be held in memory so the scope form has nothing to do with this scenario so why give that to me as an example?

 

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

 

Is my initialisation of the factory.

 

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

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

 

Gets used else where in the application when I need to add a new user that has logged in, or delete a user when they have logged out.

 

UserObject is a copy of structure of information that will hold user information.

 

So in my example it was very close to you

 

<cfset UserObject = application.userFactory.newUser()>

 

But thanks for your input any how, even though it didn’t answer what I was asking for.

 

Regards,

Andrew Scott

 

Quote of the Day:

Homer Simpson: Two hours? Why'd they build this ghost town so far away? Lisa Simpson: Because they discovered gold right over there! Homer Simpson: It's because they're stupid, that's why. That's why everybody does everything.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Kerry
Sent: Thursday, 27 October 2005 5:49 PM
To: [email protected]
Subject: RE: [CFCDev] Race Conditions when scoped in the Application variable

 

<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] ----------------------------------------------------------
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] ----------------------------------------------------------
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