Benefits & Issues
While the benefits and issues may vary between implementation, there are a few huge potential benefits and issues of this paradigm. Functionality simply requires that it knows the abstract data type of the variables it is working with. Functions and interfaces can be used on all objects with the same data fields, for instance the object's "position". Data can be grouped into objects or "entities" according to preference with little to no consequence.
While data-driven design does prevent coupling of data and functionality, in some cases, data-driven programming has been argued to lead to bad object-oriented design, especially when dealing with more abstract data. This is because a purely data-driven object or entity is defined by the way it is represented. Any attempt to change the structure of the object would immediately break the functions that rely on it. As a, perhaps trivial, example, one might represent driving directions as a series of intersections (two intersecting streets) where the driver must turn right or left. If an intersection (in the United States) is represented in data by the zip code (5-digit number) and two street names (strings of text), you might run into bugs when you discover a city where streets intersect multiple times. While this example may be over simplified, restructuring of data is fairly common problem in software engineering, either to eliminate bugs, increase efficiency, or support new features. In these cases responsibility-driven design may be promoted as a better approach, where functionality and data can be coupled together, so functions don't have to deal with the data representation itself.
Read more about this topic: Data-driven Programming
Famous quotes containing the words benefits and/or issues:
“It is with benefits as with injuries in this respect, that we do not so much weigh the accidental good or evil they do us, as that which they were designed to do us.That is, we consider no part of them so much as their intention.”
—Laurence Sterne (17131768)
“Your toddler will be good if he feels like doing what you happen to want him to do and does not happen to feel like doing anything you would dislike. With a little cleverness you can organize life as a whole, and issues in particular, so that you both want the same thing most of the time.”
—Penelope Leach (20th century)