I keep asking this since long ago, many top developers may not see the need
for it, because they mostly work on dedicated server. People that tried to
use CFCs on a shared box will see my point more easily (I work both on
dedicated and shared boxes). This is a real horror story that will prove why
we need call a CFC using a relative path, just like <cfmodule> can do with
custom tags.

Early this year I released to the public a CFC for basic image manipulation,
a few hundreds people downloaded it (v 1.2). More recently, CF 6.1 with the
included JRE 1.4 gave me the opportunity to update the CFC and add a few
additional functionalities.

I refactored the CFC, keeping 100% backward compatibility to avoid breaking
existing apps. I added a few methods/features and, since I was there, I
realized that providing a default value for the dimensions of the thumbnails
it generates made a lot of sense (again, without affecting existing apps),
so I set it to 100px. The job went fine, so after a few iterations I
released this one too (v 1.6 than 1.8). This time a few hundreds more people
downloaded it (total should be around 800).

Yesterday I started getting error notifications from an application that was
already running fine for a while. The error said the "thumbWidth" parameter
was required. That's exactly the parameter that was required inside earlier
versions of my CFC but not anymore! The version on my app folder was the
latest and greatest; I even upload it again but still no joy.

Suddenly I realized what was happening, another application was calling an
older version of my CFC using the same dot notation I was using on mine! The
host is pretty popular among CF geeks (Crystaltech), my company maintains
two others apps on them, so I checked the other apps; they were using the
latest version too.

Another user, I will never know his name, was using the older version of the
CFC on the same box, CF server caches the location of the CFCs (just like it
does with custom tags called with the <cf_mytag> syntax) and I had no
control over it. Only solution was to move my CFC in a different location
and hope the resulting dot notation was unique. In the end, I fixed the
issue rather quickly, but I really got the urge to share the story.



Years ago, the ability to use <cfmodule template="../myTag.cfm"> solved two
problems regarding custom tags:

1)  Avoid name clashing caused by CF Server caching the location of
custom tags

2)  Make it easier to deploy self contained CF apps

History is repeating itself, we are facing the same issues with CFCs, and we
need something to the rescue.

I have a few more CFCs that I plan to polish and release to the public, with
a few sample apps the use them. The apps will be self-contained, "plug and
play". But if people will use them out of the box on a shared server they
may face the same horror I reported above. I have to avoid distributing my
stuff or hope people will understand my instructions on how to make the
locations of the CFC (and the resulting dot notation) as unique as possible
(and hope for the best too!).

I feel the pain for people that distribute CFC based commercial
applications, they have to choose between making the apps harder to set up
and running, and hoping two different users will never run
different/modified versions of the CFCs out of the same box. That's weird!


Sorry for the long rant, but I think this is an important issue, I already
reported it to MM and I hope others will cast their vote too:

http://www.macromedia.com/support/email/wishform/

----------------------------
Massimo Foti
Certified Dreamweaver MX Developer
Certified Advanced ColdFusion MX Developer
http://www.massimocorner.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).

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

Reply via email to