There is a bad practice in software engineering where a single piece of data is held by value in multiple places.For example, in an FPS, the location of the player could be held by the AI class, the input class, the main class, and the graphics engine.Multiple problems can arise from this:Synchronization issuesIncreased code complexity to lock the variables till all classes have been updatedIncreased code complexity to provide setters on all classesIt becomes vastly more difficult if there are multiple inputs points to make sure that each input and output is updated each time any of the code changesObviously, best practice would be to have a single class which contained all information about the player and it would be referenced, not copped, by each other class.I want to talk about this bad practice, and I'm pretty sure it has a name, but I can't seem to find anything. I've heard the terms data duplication and data mirroring used, but I'm not sure if those are correct. Can anyone call out this term?
Name for Keeping Multiple Copies of a Variable
terminology;data;value object;data replication
The principle you're defending is that of a Single Source Of Truth. The corresponding antipattern doesn't have such a general name. Violating DRY (don't repeat yourself) is sometimes called WET (write everything twice). In databases, violating normal form is called denormalization (and is sometimes good practice when trading off time versus space). But there is no fixed phrase like Multiple sources of truth that practitioners would immediately recognize as the name of an anti-pattern.