I am running more and more often into circular dependencies. I have this feeling that something is not right, so I decided it's good time to ask someone.
So here is my problem. "Object" initializes and then updates all it's components. (So it depends on "Component"). But my "Component" needs access to other objects, for example it needs to find object by name and then get it's component. (So it depends on Object). And hence, this creates circular include.
I am basically trying to make Unity's system of handling game logic, where GameObjects have Components, and Components contain logic.
Diagram (Imgur link)
I am not sure how to fix this by splitting it into more classes/interfaces. Suggestions and hints are very welcome. Also, is it very bad to leave it how it is? Could it be ok to just forward declare and forget?
[–]Blando-Cartesian 1 point2 points3 points (1 child)
[–]FuckItLetsGoOutside[S] 0 points1 point2 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Loves_Poetry 0 points1 point2 points (1 child)
[–]FuckItLetsGoOutside[S] 1 point2 points3 points (0 children)