Thanks for the very good point Dave. But I think it depends where you are
re-creating the application CFC instances. I have changed my idea of putting
the creation of my 20 CFC Application instances. If I put them all into the
Application.cfm like the example below, the cflock name does not make sense
to be use because my 999 users will wait anyway that the application.cfm has
finish to create the entire Application scope.

So I decided to put the creation of my CFC instance to the Facade services
with a cflock name, that will make more sense I guest. So if I put into the
MailServiceFacade.cfc the cflock name="MailServiceLock" and create the
application CFC instance MailService.cfc, the execution after of, lets say,
Application.MailService.SendEmail, can execute right away. It does not need
to wait until my 19 others application CFC have been instantiated.

I guest I can put into my MailServiceFacade.cfc, in the constructor, the
creation of the Application CFC instance for MailService.cfc because when
Flash call a method of MailServiceFacade.cfc, the execution of the
constructor is always done. That's good, because we don't need to put the
creation into all methods.

Thanks Sean for your good article about facades
http://www.macromedia.com/devnet/mx/flashremoting/articles/facades.html, it
really make me understand that with Flash MX and ColdFusion MX we always
need facade services because the real constructor does not execute each time
that a method is being called by Flash and the instantiation of a the real
CFC is only done once. The instantiation of the facade service
MailServiceFacade.cfc is done every time now by Flash, but it contains
simple code and a lot less number of lines (700) than the real service
MailService.cfc (3000) which is done only once into an application scope. I
guest it might help performance when you have thousand of users.

Stephane

Building a Flash MX/ColdFusion MX site.

----- Original Message ----- 
From: "Dave Carabetta" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 29, 2003 9:49 AM
Subject: Re: [CFCDev] CFCs in memory


> >On Monday, Jul 28, 2003, at 20:19 US/Pacific, St�phane Bisson wrote:
> >>Thanks to make me understand... but I'm just questionning on one
thing...
> >>Let's take this example...
> >>
> >>I have this in my Application.cfm
> >>
> >><cfif NOT IsDefined("Application.MailService")>
> >>    <cflock scope="Application" Timeout="10" THROWONTIMEOUT="No"
> >>Type="Exclusive">
> >>      <cfif NOT IsDefined("Application.MailService")>
> >>       <cfobject component="#request.componentpath#MailService"
> >>  name="Application.MailService">
> >>      </cfif>
> >>    </cflock>
> >>  </cfif>
> >
> >Looks good.
> >
>
> Wouldn't it be better to use a named lock in this instance instead of
> locking the entire Application scope? Why exclusively lock the entire
scope
> to set one variable? Seems like an unnecessary bottleneck to me,
especially
> if it takes a while to instantiate that component. That is unless, of
> course, I'm missing something.
>
> Regards,
> Dave.
>
> _________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
> ----------------------------------------------------------
> 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).

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

Reply via email to