Hey Jeremy,

There is a core OO design rule that says "favour composition over  
inheritance".  What that means in CFCs is that you should favour:


<cfcomponent>
        <cfset rules = createObject("component",  
"com.jeremy.app.rules.SomeRules")>
        <cffunction name="applyRules">
                ...
                <cfreturn rules.validAddress(arguments.address)>
        </cffunction>
</cfcomponent>


over:


<cfcomponent extends=com.jeremy.app.rules.SomeRules">
        <cffunction name="applyRules">
                ...
                <cfreturn this.validAddress(arguments.address)>
        </cffunction>
</cfcomponent>


For the very reason you specified in your post - you can modify which  
rules you use at runtime.  Using extends/inheritance looses you a LOT  
of flexibility just to use the "this" keyword.

To put it another way - if you want to mow the lawn you get yourself  
an instance of some type of lawn mower on the day and mow the lawn.   
You don't marry the lawnmower...

Robin


On 21/02/2006, at 2:51 PM, <cfgroupie> wrote:

>
> Thanks guys,
>
> We mainly use it for business rules that our clients request so  
> that we
> totally seperate the logic of what they want and the core. But when it
> comes time to building each environment i.e Production, Test, Train it
> because a real pain as you have to manually change each extended
> location.
>
> We thought of the following.
> 1. Build a .NET application which does a major find and replace for
> each environement
> 2. remove the extends functionality for business rules and come up  
> with
> something different
>
> Thanks again guys!
>
> J
>
>


______________

Robin Hilliard
Director - RocketBoots Pty Ltd
Professional Services for Macromedia Technologies
http://www.rocketboots.com.au

For schedule/availability call Pamela Higgins:
w    +61 7 5451 0362
m    +61 419 677 151
e    [EMAIL PROTECTED]

or Direct:
m    +61 418 414 341
f    +61 2 9798 0070
e    [EMAIL PROTECTED]

  *** Register for WebDU http://www.mxdu.com 2-3 March 2006 ***



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~----------~----~----~----~------~----~------~--~---

Reply via email to