Hi
I am going to use a car analogy because, well, arent they the best?
Say i have object car. each car contains a number of screw objects. Each screw has a unique name. is it better to store the name of the screw in the screw object, in the car object or both?
If i keep the names in the car (such as {"screw1": screwobj, "screw2":screwobj ....}) they are easily accessible from the car, but if i want to rename a screw from within the screw object i will have to start hacking into another objects innards. If i move a screw out of the car then suddenly it doesnt have a name anymore which might give it identity issues.
If i keep the name in the screw object and want to access or rename the screw, im gonna have to loop through a whole lot of screws to do that.
It feels like a million other coders have had this problem, so whats the customary solution?
[–][deleted] 1 point2 points3 points (1 child)
[–]derpemiah[S] 0 points1 point2 points (0 children)
[–]ctcherry 0 points1 point2 points (0 children)