The two I would look at and use as it makes sense would be either to create
it as a custom tag someplace everyone can get to it (cfmodule calls work too
here) or make it as an application scoped udf that gets included
onapplicationstart.

We have a ton of udfs that are included once and used al over the place.

A cfc does seem to be going overboard to me.  I like the UDF Idea
personally.

-----Original Message-----
From: Shannon Rhodes [mailto:[email protected]] 
Sent: Tuesday, May 11, 2010 10:56 AM
To: cf-talk
Subject: Which code reuse method?


I'm probably overthinking this, but I have a really simple snippet of code
that I want to make easily available to other developers in-house.  It takes
no input variables; all it does is figure out the correct link to reporting
services based on the server environment (dev/QA/prod).

Given the simplicity, should this just be an include?  Or at most a UDF
(though I fail to see the point there, since you have to include those too,
and I'm not taking input parameters).  Definitely a custom tag or a cfc seem
like overkill.

However, my secondary concern is that we do not have a process for sharing
code in-house so I could see whatever method I choose turning into a sort of
default method of code reuse (even when not appropriate).  Also, I'm
thinking if I'm really going to approach this properly I need to request a
mapping to a folder above the web root rather than simply throwing in a new
folder and calling it "cfincludes".  Mappings always turn into a PITA around
here, but I want to do this right.

Advice for getting this team moving in the right direction (noting I am not
in management here)?  Thanks! 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333584
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to