Is there a way to avoid circular dependencies, other than mixing modules, in a arrangement like this(it is a chess application)
Long description:
There is the Gui module wich imports a ChessWidget module;
ChessWidget just wraps ChessWorld module and imports CellButton;
The CellButton module imports the module Cell;
The ChessWorld Module imports Board (to represent it) and Players ( to Notify them and fetch their moves)
The Board module imports module Piece;
The Piece Module imports module Player;
AND HERE IS THE PROBLEM:
module Player needs to know about other players and the board (and thus importing ChessWorld!)
***Short description:
The World needs to know about player(even indirectly by Board/Piece) and Player need to know about world;
Help is very appreciated.
PS: is not because I cant use circular dependencies, but because they are evil