First off, I have not yet read anything on design patterns.
I have a game structure like:
docClass > container > player
*(container is child of doc…player is child of container…) *
The game score (in the document class ) needs to be updated when the player performs tricks , currently the logic for the tricks reside in in the player.
Is it best to dispatch an event for this? I know there are some nice debates on this around the forum. I guess what i want to know, is it** at all **worse performance to have the doc class listen for players event, rather than have player directly tell the grandparent to update its score?
Also, to someone reading the code in the future, if player directly calls its grandparent like this, does this stick out as a noobie piece of code? I am most interested in squeezing out any performance boost i can. But also want to learn best practice.
thanks