Re: thoughts on OO design for processing messages



H. S. Lahman wrote:

> There is nothing inherently wrong with switch statements. They
> represent a particular (rather ancient and honorable) form of parametric
> polymorphism.

Parametric polymorphism has nothing whatever to do with switch statements.
Nor are switch statements any form of parametric polymorphism.

Regards
--
Adrian Hey

.



Relevant Pages

  • Re: enums, using methods as initializers
    ... Say someone wants to add a custom field extractor, its easy to change these enums into a regular class, and have the extract be a method in an interface. ... To me, an enum and a switch work nicely together, especially when the alternative is to write different versions of a big, complicated method in the definition of an enum. ... I'm not saying there are NEVER times when you can use switch statements, ... I'm just saying that by the time I need one switch statement, I probably need two, and at that point its time to use polymorphism and create an abstract method for each of my switch statements. ...
    (comp.lang.java.programmer)
  • Re: Searching OO Associations with RDBMS Persistence Models
    ... My argument was that OOPLS are often better ... because switch statements are highly coupled. ... dynamic polymorphism in a much cleaner programming environment. ...
    (comp.object)
  • Re: Switch Statements and Refactoring
    ... H. S. Lahman wrote: ... such a inclusion polymorphism or parametric ... specifications and relationships. ... Lets consider a non-typed stream interface where value semantics ...
    (comp.object)
  • Re: Abstract public member variales?
    ... I agree it is a form of polymorphism. ... Kazakov said that one could never convince Lahman to ... algorithm sharing. ... Types are related = they share behavior, and algorithms as a form ...
    (comp.object)
  • Re: Abstract public member variales?
    ... You probably will never convince H.S. ... I agree it is a form of polymorphism. ... Kazakov said that one could never convince Lahman to ...
    (comp.object)