Questions tagged [circular-dependency]

circular dependency is a relation between two or more modules which either directly or indirectly depend on each other to function properly.

1693 questions
5
votes
1 answer

What is the impact of importing from TypeScript barrel index files on Webpack v4 code-spliting / tree-shaking?

I am using TypeScript barrel index files (i.e. re-export pattern) to solve a needed cyclic dependency (i.e. circular imports) as explained in this article. However, the article's author mentioned that this could impact code-splitting / tree-shaking…
geeko
  • 2,649
  • 4
  • 32
  • 59
5
votes
1 answer

Best practice for for resolving a circular dependency in Go

I have a Go project that contains both of these packages: logging Imports config, because I want to send the current configuration to my error reporting system config Imports logging, because I want to log if the program is unable to open the…
William M.
  • 369
  • 1
  • 5
  • 10
5
votes
0 answers

Android Studio Instant Run Circular Dependency (After update)

Just updated Android Studio to 3.2.1 and as always there are problems building existing projects. This time its a Circular dependency error. After a bit of research found that disabling "Instant Run" resolves this error, but its a useful…
AlexVPerl
  • 7,652
  • 8
  • 51
  • 83
5
votes
2 answers

Understanding behavior of Python imports and circular dependencies

NOTE: This is about importing modules and not classes, functions from those modules, so I don't think it's a duplicate of the mane "ImportError: cannot import name" results in SO, at least I haven't found one that matches this. I do understand that…
filbranden
  • 8,522
  • 2
  • 16
  • 32
5
votes
2 answers

BeanCurrentlyInCreationException when @Autowired and @Bean are present in same class

@Configuration public class Test1 { @Autowired private Test3 test3; } @Configuration public class Test2 { @Autowired private Test3 test3; @Bean(name = "test3 ") Test3 test3 () { return new Test3(); } } The…
chepaiytrath
  • 678
  • 1
  • 9
  • 20
5
votes
3 answers

Avoiding circular dependencies in Django applications

While working on my Django-based projects I'm always trying to follow Django's approach to reusable apps - I'm trying to decouple my applications from each other and especially trying to avoid cross references but sometimes it does not seem to be…
Alexander Finn
  • 781
  • 4
  • 11
5
votes
2 answers

Circular-dependency best practice

I'm currently writing a web scraper which retrieves information from the internet. Simplified it looks like this. Data access project Objects to retrieve raw data Objects to parse the the raw data into objects (!!) The entities that the parser…
Timo Willemsen
  • 8,717
  • 9
  • 51
  • 82
5
votes
1 answer

Modelling association in Elm leads to dependencies cycle

My database consists of a table of items and a table of associated ads. I would like my elm app to display either an item with its associated ads, or an ad with information on the parent item. To match those interface needs, I would have liked to…
AlexHv
  • 1,694
  • 14
  • 21
5
votes
1 answer

How to initialize variables in classes that require mentions of other classes for which circular declarations would be necessary?

In the following example the forward declaration the struct Y foward declaration is not enough. If you comment out X::b, it compiles fine, since Y has a full struct declaration to work with, but X only has the forward declaration. #include…
Post Self
  • 1,471
  • 2
  • 14
  • 34
5
votes
1 answer

Vuerouter : need to import, but how to avoid circular dependency?

I try to find a solution to a problem of circular dependency. In my Vuejs application, I want a function makeUrl(url) which computes an absolute url of the given parameter by adding the $router.base value at the beginning. So I put this in my…
Thaledric
  • 539
  • 2
  • 8
  • 17
5
votes
2 answers

How do interfaces solve circular dependencies?

If you search for how to resolve circular dependencies, the answer is almost always "use interfaces". I know how this technique can be used to make a circular dependency work, but I do not understand how that is solving a circular dependency. Say I…
Raphael Schmitz
  • 551
  • 5
  • 19
5
votes
1 answer

Any tool to check circular dependency in a JSON schema

I am using JSON file and validated it on Swagger 2.0 Parser and validator it validates it but give error of circular reference, is there any free tool or website to detect the position of circular reference in a file.
Syed Uzair Uddin
  • 3,296
  • 7
  • 31
  • 47
5
votes
2 answers

Dealing with circular inclusion in a parent/child class relationship

Assume I've made a class, say Parent, that has a composition relation with Child. The parent class holds a list of children. I want all children to hold a reference to the parent, so every child holds a Parent pointer. This will cause circular…
Pieter
  • 31,619
  • 76
  • 167
  • 242
5
votes
2 answers

"too much recursion" error when calling JSON.stringify on a large object with circular dependencies

I have an object that contains circular references, and I would like to look at the JSON representation of it. For example, if I build this object: var myObject = {member:{}}; myObject.member.child = {}; myObject.member.child.parent =…
Tyler
  • 21,762
  • 11
  • 61
  • 90
5
votes
3 answers

Friend function massacred by circular includes

Class A is the sole instantiator and container of instances of class B. So it seemed like a good idea to make the constructor of class B private, and call it only by a friend function declared in class B and defined in class A. File A.h (EDIT:…
pbyhistorian
  • 341
  • 2
  • 10