Yes, they're a code-smell. They often indicate that the code isn't very flexible.My first question is circular dependencies. Are they bad ? People say they are a flaw in the design.
Yes, such two-way parent/child connections should be quite rare.Is it wrong to think that every component has to have a two-way connection to it's owner/child ?
If you apply the SRP to the renderer so that it's broken into several sub-classes, it might be easier to break this down. e.g. move all the shader code into a Shader Pool that is owned by the Renderer.MaterialClass - Has an instance of the renderer component class and uses this to get .e.g the rendering device to create shader resources...
and at the same time the renderer has to work with the material class.
e.g. Renderer has a Shader Pool. Renderer uses Materials. Material uses Shader Pool.
(has a == member variable, uses == passed as an argument to a function)
All these relationships are one-way (top down) - classes are only aware of the ones below themselves.
Renderer | \ | \uses | \ owns| Material | / | /uses | / ShaderPool[edit] oh F^&#$*^ #$&$#( balls. The stupid code editor threw away all the text after the code box! [/edit]