wow Dwayne, that's a lot of attributes.
To me, it comes to a certain point where reusability just needs to give 
way to practicality. However, when looking at your code, I'm reminded of 
something a little familiar...

ah yes, here it is, the ASP.NET textbox control list of members:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolstextboxmemberstopic.asp

Still though, how about a cfcomponent for the offices list gui object, 
then set a few variables and call a show() function? How about 
showDefault() and a few showCustom() variations like 
showCustomInOfficeDefault(). That would cut down on my complaint about 
aspnet's form controls, having large tags and seemingly endless attributes.

obj.displayListOffices(12,6,4,"http://blah";... ... ... ... [snip] ...)

could possibly be cut down to

listOffices.showCustomSuperDuper(prop1,prop2)

If you like, your function below could still be in there, just kinda 
hidden and private. See, objects should simplify life for other systems, 
and if you can't, then build a simplified interface (a façade) for it

Anyways, points to ponder for the weekend.

-nathan strutz
http://www.dopefly.com/



Dwayne Cole wrote:
> 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
>>
>>
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197547
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