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 issues
- Increased code complexity to lock the variables till all classes have been updated
- Increased code complexity to provide setters on all classes
- It 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 changes
Obviously, 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?