On Thu, 20 Jan 2005 06:32:10 -0800, Joe Rinehart <[EMAIL PROTECTED]> wrote:

> This is what I was trying to get at - C depends on ThingyHolder have a
> getThingy(), but it doesn't depend on the result of getThingy() being
> a specific type, just that it's "contract bound" to have a
> doSomething() method.
I could make A and B work the same way by changing one line.
<cfargument name="thingy" type="any"> <!--- instead of com.useful.Thingy --->



> >C is an example of a factory - C depends on the factory to provide the
> >actual object to operate on.
> 
> I get it, light bulb, it's letting another class decide what actually
> gets instantiated, and because that class doesn't need to be a
> concrete Thingy, just something that implements what a Thingy is, we
> just became more flexible by not relying on a concrete but an
> abstract..right?
Yes. But I don't actually need a ThingyHolder. In all three cases, the
Thingy is being instantiated by another class. In C, it's just a
little more obvious because the factory is part of the example.


> I try to avoid inheritance because it seems like an easy route to do
> things that can come back to bite me later, and the alternate
> solutions using coupling I've tried end up being much more elegant.
>
> I'm a little confused, though, as to handle polymorphic concerns in CF
> without it.  If we did have some sort of abstract functionality, it'd
> be great.  Right now, I flip-flop between 1) using inheritance to
> mimic the typing 2) having the actualy abstraction be an unenforced,
> completely virtual concept with methods taking and returning type
> "Any".

After this discussion I'm leaning toward #2.  

Patrick

-- 
Patrick McElhaney
704.560.9117
http://pmcelhaney.blogspot.com
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]

Reply via email to