C# program has classes.
(I guess it doesn't matter this is C#. Any OOP language will do.)
one class represents a Team
other class represents a Player
A Team has a "List of Players"
A Player has a "List of Teams" he/she plays on.
Now, when a Player joins a Team, we need to update two lists:
This leaves open the possibility of having an inconsistent set of data. If we update one list and not the other.
Does this make sense? Perhaps a Team thinks a Player is on it's team, but nobody told the Player?
Or a Player thinks it's on a Team, but nobody told the Team?
Can we eliminate this possibility of having an inconsistent set of data?
(or is the data not really inconsistent?)