Circular dependencies
Last updated
Last updated
A circular dependency problem occurs, when two or more services depend on each other. By default, the dependency injector cannot resolve this issue, because the resolving would end up in an infinite loop, as the dependencies would keep requesting each other.
For most cases, it is recommended to avoid services referencing to each other.
The following code will throw a CircularDependencyException
.