Data-driven program design refers to the implementation of such programs that directly process the data files. The contents of those data files contain the information about the operations to be performed. In data-driven programming, the data is not stated as the value of some objects, defines the overall implementation of the program. Everything is implied on data only e.g. reading the data, processing it, and producing the output. One can govern the flow by submitting different data sets to the program and the program logic is a result of standard flow or the change in states of data. Data-driven approach doesnâ€™t define the sequence of steps taken to perform some task but describes the data as an input stream and being processed. The data for data-driven program design is the key element for whole program design and it is given in the form of data files, data scripts or different data sets. Some programming languages that follow data-driven approach are AWK, sed, Oz and Clojure; these languages treat the program code as data and process it. Most of these languages are intended for text processing and used as a tool for data extraction.
Data driven program design paradigm structures the programs through data structures rather than writing complex code for it. Data and structure of program is being arranged in the form of data files given as input and the received data as output to the program. Data-driven programming is very convenient, effective and majorly used in business applications. Here, inputs and outputs are based on organized records of various real-world entities such as objects, people, services or products. Data-driven approach works on real-world data entities and developing the applications by modifying the structure or behavior of these entities. The program statements in data-driven programming are derived from data included in files or scripts instead of writing a sequence code. Type of statements written in data-driven program are based on input data items and given operation to be performed on these data items. Example of a pseudo code using data-driven approach:
1 items_set = [(a,b), (p,q), (x,y)]
2 for each item in items_set
These could be the sample statements while writing a code in data-driven program; it defines the data input as items_set which includes a predefined set of entities. Then operation to be performed on all data items that can be a mathematical computation or something must be applied directly to the range of data items rather than each value of the variable.
Apart from input files or stream of data, control tables are used as a type of data-driven program design. Control tables work on the methodology of developing the tables which include the programâ€™s logic with the help of data structure. It does not comprise of lengthy lines of code used in various programming languages. Control tables control the flow of program and there are not firm rules to define its structure or contents.