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
6
votes
1 answer
Circular dependency issue while exporting from single file using babel-module-resolver
I was working on a react native project and while perfoming hot reloading app goes into cyclic recursion resulting in maximum call stack exceeded. More details of this issue can be found here
From here I realised that there is something wrong and…

Harkirat Saluja
- 7,768
- 5
- 47
- 73
6
votes
1 answer
Best practice for structuring module exceptions in Python3
Suppose I have a project with a folder structure like so.
/project
__init__.py
main.py
/__helpers
__init__.py
helpers.py
...
The module helpers.py defines some exception and contains some method that raises that…

Olivier Melançon
- 21,584
- 4
- 41
- 73
6
votes
1 answer
EF Core 2.0 - Circular Dependency with required FK on either end
I have a fairly simple data model consisting of two entities:
public class User
{
public int Id { get; set; }
public string Name { get; set; }
public int CurrentLocationId { get; set; }
public List Locations { get; set; }
…

Stu Ratcliffe
- 269
- 3
- 14
6
votes
1 answer
Circular reference for typedef of function pointer in C
I would like to define a hash table with a swappable hash function. The hash function would take a pointer to the hash table and the key to be hashed, returning an int like so:
typedef int (hash_function_t) (hashtable *, int);
where the hashtable…

majelbstoat
- 12,889
- 4
- 28
- 26
6
votes
1 answer
Angular 2 : Circular Feature module dependency
I am currently working on one of application of Angular2. I have 3 feature modules in it which contains other sub feature modules.
I want to load Sub feature module of Feature 1 into Sub Feature module of Feature 2 and vice a versa. below is sample…

Parikh Vaibhav
- 199
- 2
- 12
6
votes
2 answers
Flask circular dependency
I am developing a Flask application. It is still relatively small. I had only one app.py file, but because I needed to do database migrations, I divided it into 3 using this…

pavlos163
- 2,730
- 4
- 38
- 82
6
votes
2 answers
Circular dependencies between classes: why they are bad and how to get rid of them?
I feel circular dependencies (aka circular references) mean bad design and harm the project. How can I convince my teammates and my manager?
My project is a dependency mess. Is there a methodology to get rid of wrong dependencies and then maintain…

polina-c
- 6,245
- 5
- 25
- 36
6
votes
3 answers
Angular: circular dependency of specific case
Some time ago, I started to refactor my code of the main project, decoupling the business logic from controllers to services, according to guidelines. Everything went well, until I faced the problem of circular dependency (CD). I read some resources…

omalyutin
- 445
- 7
- 24
6
votes
1 answer
Circular imports in python3
I have a package which contain several files. Each file contains a class and the classes are interdependant. How can I avoid circular dependencies without putting all the code in one file. Is there a better way to refactor the code or is there a way…

freeza
- 368
- 1
- 4
- 13
6
votes
2 answers
Dynamically creating graphql schema with circular references
By using graphql-js, I need to create graphql schema dynamically by iterating over array of some data, for example:
[{
name: 'author',
fields: [{
field: 'name'
}, {
field: 'books',
reference: 'book'
}]
}, {
…

User Created Image
- 1,182
- 2
- 17
- 33
6
votes
1 answer
Can template inheritance from its another specialization be a circular dependency or is it a clang's bug
Consider code below:
#include
#include
#include
template
struct assign;
template
struct assign,…

W.F.
- 13,888
- 2
- 34
- 81
6
votes
4 answers
Makefile circular dependency
Here is my Makefile:
.PHONY: all homework1
CFLAGS= -g -O0 -Wall -Werror -Wno-unused-function
LDFLAGS= -lm
all : homework1
homework1 : program.tab.o program.lex.o
%.o : %.c
gcc -o$@ -c $(CFLAGS) $<
%.lex.c : %.lex %.tab.h
flex -o$@…

Mike
- 654
- 2
- 7
- 22
6
votes
4 answers
Are circular references ever necessary?
I've inherited a Visual Studio Solution that contains numerous circular references between Projects.
Is there ever a situation where this is remotely acceptable?
Just trying to confirm my suspicion that this application is designed horribly. Thanks…

John B
- 20,062
- 35
- 120
- 170
6
votes
4 answers
python workaround for circular import
Ok so it is like this.
I'd rather not give away my code but if you really need it I will. I have two modules that need a bit from each other. the modules are called webhandler and datahandler.
In webhandler I have a line:
import datahandler
and in…

Adam Griffiths
- 680
- 6
- 26
- 60
6
votes
2 answers
Jackson Circular Dependencies
I have a circular dependency that I am struggling to solve right now
Take these two classes - boiler plate code removed for demo purposes
Class 1
@Entity
@Table(name = "T_CREDENTIAL")
@Cache(usage =…

Damien
- 4,081
- 12
- 75
- 126