When using the "service factory" pattern for this purpose, what should the
"returnType" value be set at in a <cffunction> tag that's returning a
component?

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Barney Boisvert
Sent: Friday, September 19, 2003 11:25 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] Storing Objects in App Scope


Load a manager/factory once at application start up.  Then as you need the
other objects, call the appropraite methods on the manager, which will
either instatiate the object (using a lock, of course), or return a
reference to an already instatiated one.

public MyCFC getMyCFC() {
  if (NOT structKeyExists(this, "myCFC")) {
    lock_exclusive {
      if (NOT structKeyExists(this, "myCFC")) {
        this.myCFC = new MyCFC();
      }
    }
  }
  return myCFC;
}

This way all the nasty locking crap is encapsulated in that one CFC< rather
than being spread all around your application.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Stacy Young
> Sent: Friday, September 19, 2003 11:13 AM
> To: [EMAIL PROTECTED]
> Subject: [CFCDev] Storing Objects in App Scope
>
>
>
> How do you folks approach storing objects in app scope? Do you have an
> initialization process that loads all objects in memory...or doing
> things like <cfif NOT IsDefined("application.mycfc")> around each
> invocation?
>
> Cheers,
>
> Stace
>
>
>
> AVIS IMPORTANT:
> -------------------------------
> Les informations contenues dans le present document et ses pieces
> jointes sont strictement confidentielles et reservees a l'usage
> de la (des) personne(s) a qui il est adresse. Si vous n'etes pas
> le destinataire, soyez avise que toute divulgation, distribution,
> copie, ou autre utilisation de ces informations est strictement
> prohibee. Si vous avez recu ce document par erreur, veuillez s'il
> vous plait communiquer immediatement avec l'expediteur et
> detruire ce document sans en faire de copie sous quelque forme.
>
> WARNING:
> -------------------------------
> The information contained in this document and attachments is
> confidential and intended only for the person(s) named above. If
> you are not the intended recipient you are hereby notified that
> any disclosure, copying, distribution, or any other use of the
> information is strictly prohibited. If you have received this
> document by mistake, please notify the sender immediately and
> destroy this document and attachments without making any copy of any kind.
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.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 word 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.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 word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

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

Reply via email to