All the time!

I use one cfc that returns a list of office locations. Simple enough right.  
Well this same cfc is used by 10 different sites and in each case the output is 
some what different.   To me, a list of offices is a list of offices sure we 
may have different output versions for example a 2 column output, a list out 
put, and output with an image to the right or an output with an image to the 
left, but the list is still a list.  So we use a single cfc and pass arguments 
that help us control the output.  Here's the good thing, If we add another 
"display" version it's available to anyone of the sites.  

I use cfc not for objects but for extreme code reuse.  With most of mysites, as 
much as 70 percent of the code is reused code, not copy and past but shared and 
reused.

True, the functions have, in some case 50 attributes but to me its worth it.  
Here's sample of the function and arguments.

<cffunction name="displayListOffices" hint="I return a list of offices">
        <cfargument name="id_office_cat"
        <cfargument name="id_firm>
        <cfargument name="itemsOut>
        <cfargument name="link">
        <cfargument name="linkback">
        <cfargument name="showListType">
        <cfargument name="showListTitle">
        <cfargument name="isShowDirectorySectTitle">
        <cfargument name="isNameLink" 
        <cfargument name="isShowOfficeTitle"">
        <cfargument name="isShowOfficePhone" ">
        <cfargument name="isShowOfficeContact">
        <cfargument name="isShowOfficeContactEmail">    
        <cfargument name="isShowOfficeAddress"                  default="false" 
required="No">  
        <cfargument name="isShowImage"                          default="false" 
required="No">
        <cfargument name="ItemStyle" 
        <cfargument name="cssFormatDirSectionTitle"
        <cfargument name="styleFormatDirSectionTitle"
        <cfargument name="cssFormatTitle"
        <cfargument name="cssFormatBody"
        <cfargument name="FormatRowOdd"                 
default="background-color:##ffffff;">
        <cfargument name="FormatRowEven"                
default="background-color:##ffffff;">                   
        <cfargument name="BlockFormat"                  default="c5"            
required="No">
        <cfargument name="BlockStyle"                   default="" 
required="No">
        <cfargument name="BlockSize"            default="N"             
required="No">
        <cfargument name="BlockColumnCount"             default="1"             
required="No">  
        <cfargument name="BlockColumnWidth"             default=""              
required="No">  


        <cfargument name="isLink"                default="True" required="No">
        <cfargument name="Iconlink"             default="more..." 
required="No"><!--- text or image to use and a read more link--->
        
        <cfargument name="ImagePos"             default="Float:Right; 
margin-top:10px; margin-left:5px;" required="No">
        <cfargument name="ImageWidth"           default="" required="yes">
        <cfargument name="ImageHeight"          default="" required="yes">      
        <cfargument name="ImageCSS"             default="defaultImage">         
        

---------- Original Message ----------------------------------
From: "COLLIE David" <[EMAIL PROTECTED]>
Reply-To: cf-talk@houseoffusion.com
Date:  Thu, 3 Mar 2005 19:47:16 -0000

>> And if you don't agree with me, I'll take my Property p = new
>> Property(Ball.Color("Red")) and Structure.Home.Go()
>
>That's one of the funniest things I've read all week!!! (It's been a
>hard one :)
>
>-- 
>dc
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197402
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to