Re: Poly Couples



topmind a écrit :
(snip)
> IF statements are simply more bendable and flexible to handle real-world
changes. You can refine them without moving lots of code around.

But not without modifying existing code. And in a lot of cases modifying it in *many* places. What polymorphism brings is mainly using another way of doing the dispatch that doesn't require explicit branching - so it doesn't require modification of the calling code. This is of course not enough to isolate all code of all possible change, but it's still a pretty useful tool -- and a very often used, one way or another.

(snip - already addressed in some other post)

If one is going to hammer on "coupling", then
you cannot pick and choose which coupling you keap and which you reject
without justification.

Not "without justification".

If *all* coupling is bad,

Where did you get the baroque idea that "all" coupling would be bad ? What we want is to avoid coupling between parts that have (or may have) to change independantly (and I agree that deciding what should be decoupled from what is not always easy). Now the problem addressed by polymorphism is how to decouple usage from implementation (not to decouple from usage from usage, which would be totally meaningless) . In other terms, it's a matter of "what, not how" - something that DBMS try to solve in the domain of data management BTW.
.



Relevant Pages

  • Re: Poly Couples
    ... But not without modifying existing code. ... What polymorphism brings is mainly using another ... (snip - already addressed in some other post) ... decouple from usage from usage, ...
    (comp.object)
  • Re: What could f(this:that=other): mean?
    ... I've posted usage examples elsewhere in this thread. ... by using ':' the namespacing is explicit. ... two or more dictionaries. ...
    (comp.lang.python)
  • Re: Life" by Richard Fortey
    ... you about peer review? ... rules of usage. ... and I know how much you despise long quoted posts. ...
    (talk.origins)
  • Re: Is this fully portable and/or smart?
    ... root of C, isn't it.) ... My rather modest experience indicates that C's main usage these days ... is with various "embedded" systems and maintenance of old code on ...
    (comp.lang.c)
  • Re: "Assignment" through base class
    ... > modifying the original? ... > void save ... Stephan Brönnimann ...
    (comp.lang.cpp)