Control table: Difference between revisions

Content deleted Content added
KISS
Remove fluff
Line 2:
{{Refimprove|date=February 2009}}
[[File:Control table.png|thumb|220px|A simple control table that directs program flow according to the value of a single input value. Each entry holds a possible input value and an associated subroutine to invoke.]]
A '''control table''' is a [[Array (data structure)|array]] of [[Record (computer science)|record]]s used to direct the [[control flow]] of a [[computer program]]. [[Software]] that uses a control table is said to be ''table-driven''.<ref>''Programs from decision tables'', Humby, E., 2007,Macdonald, 1973 ... Biggerstaff, Ted J. Englewood Cliffs, NJ : Prentice-Hall {{ISBN|0-444-19569-6}}</ref><ref>{{Cite web |url=http://www.dkl.com/wp-content/uploads/2016/05/DataKinetics-Table-Driven-Design.pdf |title=Archived copy |access-date=17 May 2016 |archive-date=10 June 2016 |archive-url=https://web.archive.org/web/20160610160908/http://www.dkl.com/wp-content/uploads/2016/05/DataKinetics-Table-Driven-Design.pdf |url-status=dead }}</ref> InA somecontrol cases,table controlencodes tablesboth cana be[[conditional specific(programming)|conditional implementationsexpression]] ofand a [[finite-stateFunction machine(computer programming)|finite-state-machinefunction]]-based [[automata-basedreference programming(computer science)|reference]]. IfUsing therea arecontrol severaltable hierarchicalcan levelsreduce ofthe controlneed tablefor theyrepetitive maycode behavethat inimplements athe mannersame equivalentlogic. The two-dimensional nature of most tables makes them easier to [[hierarchicalview stateand machine|UMLupdate statethan machine]]sthe one-dimensional nature of program code.
 
Control tables often have the equivalent of [[conditional (programming)|conditional expressions]] or [[subroutine|function]] [[reference (computer science)|references]] embedded in them, usually implied by their relative column position in the [[association list]]. Control tables reduce the need for programming similar [[data structures|structures]] or program statements over and over again. The two-dimensional nature of most tables makes them easier to view and update than the one-dimensional nature of program code.
 
In some cases, non-programmers can be assigned to maintain the content of control tables. For example, if a user-entered search phrase contains a certain phrase, a URL (web address) can be assigned in a table that controls where the search user is taken. If the phrase contains "skirt", then the table can route the user to "www.shopping.example/catalogs/skirts", which is the skirts product catalog page. (The example URL doesn't work in practice). Marketing personnel may manage such a table instead of programmers.
 
==Use==