IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Along similar lines...
Polymorphic dispatch from an OOP perspective also solves the problem. Instead of building the logic for the code in the user, build a common interface for the objects and have the object itself define what happens in the specific situation.

And, yes, Control Tables as a method of dispatch will go unmentioned. :-)
New Multimorphism
Polymorphic dispatch from an OOP perspective also solves the problem. Instead of building the logic for the code in the user, build a common interface for the objects and have the object itself define what happens in the specific situation.

Only in "clean" shape, animal, device-driver, and stack examples. The real world often dispatches on multiple orthogonal criteria such that OO polymorphism cannot handle it nicely because polymorphism is mostly mono-dispatch.

Nor is it always convenient to make a seperate class for every combination of multiple orthogonal dispatching factors in order to partition them. At least case statements can be turned into IF statements when things get complex without having to do the Class Shuffle. Thus, case statements are more change-resistent.

And, yes, Control Tables as a method of dispatch will go unmentioned

Generally not a strong candidate unless the case list gets long and/or is duplicated in multiple spots.
________________
oop.ismad.com
     Programming algorithms, switch() and Perl. - (static) - (25)
         well its not perl - (boxley) - (1)
             That's a point. - (static)
         What's the diff? If it needs a "break", it's just as stupid! -NT - (CRConrad) - (13)
             The difference is ... - (drewk) - (1)
                 Right, slight assembler efficiency gain. -NT - (admin)
             Re: What's the diff? - (admin) - (10)
                 Couple more - (tuberculosis)
                 It's a kind of concealed goto. - (static)
                 Scott's closest, but not even he got it - my fault, though: - (CRConrad)
                 VB does some things right - (tablizer) - (6)
                     If I'm not mistaken... - (ChrisR) - (1)
                         poor substitute for Boolean expressions - (tablizer)
                     Well, close. But cooler is the range stuff - (tseliot) - (3)
                         Fugly syntax kind'a repeats itself: YTF "select" AND "case"? - (CRConrad) - (2)
                             Not trying to imply invention - (tseliot)
                             Pascal was invented before Visual BASIC - (orion)
         One more thing: - (jb4) - (2)
             Constant vs an expression - (ben_tilly) - (1)
                 That's sorta what I figger... -NT - (jb4)
         Comments and thoughts... - (Simon_Jester) - (5)
             Along similar lines... - (ChrisR) - (1)
                 Multimorphism - (tablizer)
             Sometimes that's overkill. - (static)
             $foo->{$key} - (admin)
             You are probably thinking of - (ben_tilly)

But at least you can make it swallow the code.
137 ms