Questions tagged [table-driven]

Table-Driven algorithms lookup information (usual states) in a table to perform subsequent operations. They are essentially used for a variety of automaton algorithms such as finite-state-machines.

18 questions
0
votes
1 answer

replace switch-case statements with table-driven approach

I'm refactoring some existing code which converts between A and B using switch-case statements, it looks like this:
jfly
  • 7,715
  • 3
  • 35
  • 65
0
votes
1 answer

Table-driven factory vs inheritance

I have a bunch of derived classes that only differ by the static methods. (It's Ruby, but question is not about Ruby, it's about the design.) class Exporter def export # ... end end class ExporterA < Exporter def from 'aaa_table' …
Vadim Pushtaev
  • 2,332
  • 18
  • 32
0
votes
2 answers

How can i use Table Driven methods with delegate and Dictionary?

Hi i have been exhausted too many if comparization. and switch case methods. i have been read below issue: Best table / enum driven method calling system this usage is good. Look Vivek's responses. My usage Below but i can not this. namespace…
loki
  • 2,926
  • 8
  • 62
  • 115
1
2