On Saturday, August 3, 2002, at 03:27 , Stacy Young wrote:
> Well I'm extending a current CFC that returns an object (struct of
> resultsets - no worries not for remote use)
>
> This wrapper CFC manages the resultset in session scope and carries a few
> local methods I can execute on this subset of data...say for example I
> wanted to re-sort one of the recordsets etc...

This makes a great illustration for why inheritance is not always the 
right choice. When we say B extends A, we should do iff (if and only if) B 
is-a A. If that relationship doesn't really hold true, then we should find 
another way to do it, usually by aggregation - B contains A, i.e., B has a 
data member of type A.

Quite often something that looks like it ought to be:

        A
        B extends A
        C extends A
        D extends A

is better implemented as:

        A
        X (contains A instance)
        B extends X
        C extends X
        D extends X

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to