Yes. A Point needs to know who its Board is so that it can delegate certain questions/actions to its Board.
Having a contained object delegate questions about "location" and "neighbors" to its container is a frequent pattern in OO-land. It usually leads to smaller (and more flexible) class definitions for the contained objects.
Try approaching the problem by way of the question "Which is a more appropriate place to implement this behavior: Board, or Cell?"
In reply to (dws)Re: OO vs. global variables...
by dws
in thread OO vs. global variables...
by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |