circular dependency is a relation between two or more modules which either directly or indirectly depend on each other to function properly.
Questions tagged [circular-dependency]
1693 questions
7
votes
2 answers
Circular Dependency in Backbone / RequireJS Nested List
I'm setting up a nested categories structure in Backbone with RequireJS.
In this structure, a categories collection contains category models, and a single category model can contain a categories collection.
Unfortunately this seems to cause the…

user1031947
- 6,294
- 16
- 55
- 88
7
votes
1 answer
C++ - circular dependence (using inner type of subclass in templated base class)
I run into problem with circular dependence in a templated class. There is a code sample:
template struct A
{
typedef typename T::C D;
//typename T::C c;
};
struct B : public A
{
struct C {};
};
When I try to instantiate B,…

Loom
- 9,768
- 22
- 60
- 112
6
votes
1 answer
How to avoid circular Trigger dependencies in MySQL
I have a little probleme using Triggers in MySQL.
Suppose we have 2 tables:
TableA
TableB
And 2 Triggers:
TriggerA: fires when deleting on TableA and updates TableB
TriggerB: fires when deleting on TableB and deletes in TableA
The problem is…
user179476
6
votes
3 answers
SQL: Avoid circular dependencies
I see that most people just hate having a circular dependency in the database design. And since the support for this is "tricky" in most database engines, I was wondering if there's a way around this design:
I have a users table and a pictures…

willvv
- 8,439
- 16
- 66
- 101
6
votes
3 answers
Circular DLL dependencies in .NET
I have a DLL which provides an entry point to an ASP.MVC application. Let's call this Primary.DLL. In Primary.DLL, there are LINQ-to-SQL data context and other classes defined. Somewhere in Application_Start(), Assembly.Load() is called to load…

Kevin Le - Khnle
- 10,579
- 11
- 54
- 80
6
votes
2 answers
Circular import issues in Objective C & Cocoa Touch
I have a view controller in Cocoa Touch that detects when the device rotates and switches between the views of the 2 view controllers it has: landscape and portrait.
I want the UIViewControllers in it to be able to access the…

cfischer
- 24,452
- 37
- 131
- 214
6
votes
3 answers
Circular Dependencies / Incomplete Types
In C++, I have a problem with circular dependencies / incomplete types. The situation is as follows:
Stuffcollection.h
#include "Spritesheet.h";
class Stuffcollection {
public:
void myfunc (Spritesheet *spritesheet);
void myfuncTwo…

Ben
- 15,938
- 19
- 92
- 138
6
votes
2 answers
Autofac property injection
I am in the process of changing my Asp.Net MVC3 project to use Autofac for service injection into my controllers. So far this has been pretty straightforward. My services all have a Telerik OpenAccess db property which I inject through the…

t316
- 1,149
- 1
- 15
- 28
6
votes
1 answer
How to get rid of this circular dependency?
I am currently writing a few classes to deal with localization in a PHP web application.
The classes are:
Locale - Deals with setting and getting the user's locale, timezone, language.
LocaleFormat - Deals with formatting dates, collations,…

F21
- 32,163
- 26
- 99
- 170
6
votes
3 answers
Critique of immutable classes with circular references design, and better options
I have a factory class that creates objects with circular references. I'd like them to be immutable (in some sense of the word) too. So I use the following technique, using a closure of sorts:
[]
type Parent() =
abstract Children :…

Daniel
- 47,404
- 11
- 101
- 179
6
votes
1 answer
React Custom Hooks Circular Dependency
I have two custom hooks i.e useFetch and useAuth. useAuth has all API calls methods (e.g logIn, logOut, register, getProfile etc) and they use useFetch hook method for doing API calls. useFetch also uses these methods for example logOut method when…

artsnr
- 952
- 1
- 10
- 27
6
votes
4 answers
Circular dependencies versus DRY
I'm designing a re-usable class library that contains 2 assemblies (amongst others) named core.xml.dll and core.string.dll.
The xml assembly references the string assembly in order to use some string helper methods.
However now there is an string…

Ash
- 60,973
- 31
- 151
- 169
6
votes
2 answers
Plot circular gradients using numpy
I have a code for plotting radial gradients with numpy. So far it looks like this:
import numpy as np
import matplotlib.pyplot as plt
arr = np.zeros((256,256,3), dtype=np.uint8)
imgsize = arr.shape[:2]
innerColor = (0, 0, 0)
outerColor = (255, 255,…

bunkus
- 975
- 11
- 19
6
votes
3 answers
Complex circular dependency
what is the the best practice of solving circular dependency in C++?
I could use the forward declaration, but then I get the pointer to incomplete class type is not allowed error. Does that mean that two classes that uses each others pointer cannot…

Mikulas Dite
- 7,790
- 9
- 59
- 99
6
votes
2 answers
Circular dependency in Android project
I am working on an app which is based on pjsua2 library.
When i run the project on any version of android below Oreo, it works fine and I am able to debug the app. But when I try to debug it on my new handset which have android version Oreo, it…

Shr'Ma Dexterity Ratnesh
- 111
- 1
- 5