From: Patrick May on
"Nick Malik [Microsoft]" <nickmalik(a)hotmail.nospam.com> writes:
> "Patrick May" <pjm(a)spe.com> wrote in message
>> So you have never encountered a single developer who understands
>> procedural and relational programming but still finds value in OO
>> techniques? Not one?
>
> Hello Patrick,
>
> The person who calls himself 'topmind', while an intelligent and
> outspoken individual, has been haunting this board for quite some
> time. He has been challenged by dozens of folks, including
> yourself.

Nick,

I was in an optimistic mood when I saw the original post that
started this subthread. I'm hoping that, eventually if not now, he'll
realize that his sweeping claims aren't compelling when people don't
understand his basis for them. I'd personally like to know how he has
reached conclusions so different from mine and those of people I've
worked with over the years.

> With all due respect to -T-, many great thinkers were not
> appreciated by their peers, but they persisted. That said, for
> every good idea that has been championed by dedicated folks now
> recognized as visionary, there were one hundred more ideas
> championed by people who were just as lucid, dedicated, and
> persistent, but whose ideas have since been forgotten.

"They laughed at Galileo, they laughed at Newton, but they also
laughed at Bozo the Clown."

> It's fun to discuss OO vs Relational with topmind... once. Some try
> more than once. Don't expect to change his opinion, though.

At this point I'm just trying to understand the path he took to
get to his current position.

Regards,

Patrick

------------------------------------------------------------------------
S P Engineering, Inc. | Large scale, mission-critical, distributed OO
| systems design and implementation.
pjm(a)spe.com | (C++, Java, Common Lisp, Jini, middleware, SOA)
From: frebe73 on
> > Lets say we have a method processOrder and the behavior of this method
> > depends both on the premium and domestic/international criteria. Where
> > will we put the implementation? (I am not saying that subtyping and
> > inheritence is a bad thing, I only trying to say that it is not very
> > likely to be used a lot in enterprise (web) applications, as the OP
> > already has found out).
>
> Strategy pattern or Bridge pattern should take care of this rather nicely.
> One Order object, with one ProcessOrder method.
> Specific parts of the processing can be delegated to child objects
> (strategy). If the order object itself is subclassed, then you have Bridge.
> I don't know enough about the actual variations in this example to decide on
> which implementation may work, but regardless, you do NOT have an explosion
> of types if you use actual design patterns.

If you are careful about when to use polyorphism, you will not have an
explosion of types. Using strategy pattern, processOrder method in the
Customer class is not a polymorphic method. My point is that it is not
very likely to be any polymorphic methods in classes like "User" or
"Customer". In classes with much less responsibilities, like
"PremiumStrategy" or "ShippingStrategy", polymorphism may be useful.
But these will in many cases be reduced to a single function pointer.

Fredrik Bertilsson
http://frebe.php0h.com

From: frebe73 on
> > Is Guest/Premium the only way you need to classify users? What if you
> > later find it that you need to have different functionality for
> > domestic and international users? How would the user subtypes look like
> > (DomestGuestUser, InternationalGuestUser, DomesticPremiumUser,
> > InternationalPremiumUser)? What if yet another dimension is introduced.
> > Subtyping can be very dangerous. It is very unlikely that a entity such
> > as user only need to be classified in only one dimension.
>
> Bridge Pattern
>
> Haven't you read Design Patterns?

Yes, I have. But this debate is about advantages and disadvantages of
polymorphism. Not about different design patterns.

Fredrik Bertilsson
http://frebe.php0h.com

From: Bruno Desthuilliers on
frebe73(a)gmail.com a ?crit :
>>>Is Guest/Premium the only way you need to classify users? What if you
>>>later find it that you need to have different functionality for
>>>domestic and international users? How would the user subtypes look like
>>>(DomestGuestUser, InternationalGuestUser, DomesticPremiumUser,
>>>InternationalPremiumUser)? What if yet another dimension is introduced.
>>>Subtyping can be very dangerous. It is very unlikely that a entity such
>>>as user only need to be classified in only one dimension.
>>
>>Bridge Pattern
>>
>>Haven't you read Design Patterns?
>
>
> Yes, I have. But this debate is about advantages and disadvantages of
> polymorphism. Not about different design patterns.

I clearly see how polymorphism can help, but I fail to see what the
"disadvantages" of polymorphism could be (unless you count "doesn't
solve my actual problem" as a "disadvantage").

From: Bruno Desthuilliers on
H. S. Lahman a ?crit :
(snip)
>
> The long term future of OO lies in UML as a 4GL.

Lord, have mercy :(