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
0
votes
2 answers

Java, Maven: Models and Utils Circular Dependency, Combined Naming Convension

We have a project that has several war files that reference one-another. I've recently realized that there is a circular-dependency between two, in particular, the utils and the models. Other services use both of these, and the utils was created…
Matt
  • 5,408
  • 14
  • 52
  • 79
0
votes
2 answers

C++ circular construction dependency: class constructors taking a pointer to each other

I have the following classes class a { std::shared_ptr b_ref; public: a(std::shared_ptr b_ref) : b_ref(b_ref) {} }; class b { std::shared_ptr a_ref; public: b(std::shared_ptr a_ref) : a_ref(a_ref)…
eclipse
  • 2,831
  • 3
  • 26
  • 34
0
votes
1 answer

Angularjs Interceptor Circular Dependency when using Refresh Tokens

Long story short, I have a structure in my angularjs app which is basically the following: 1. There is an 'authService' that is in charge of requesting access tokens, and refresh tokens. 2. There is an 'authInterceptorService' that adds the token to…
0
votes
2 answers

Why forward declaration and pointer (or reference?) can resolve circular dependency?

I know circular dependency can be resolved by forward declaration and pointer like this: A.h class B; class A{ public: void update(B* b); void test(){} }; A.cpp #include "A.h" #include "B.h" void A::update(B* b){ b->test(); } B.h class…
ggrr
  • 7,737
  • 5
  • 31
  • 53
0
votes
1 answer

Configuration for multiple projects

My Project I'm writing a Winform application using VS C# 2.0 which consists in several libraries and two executables, each in its own project file and all part of the same solution. Each project has its own Settings Class which configuration…
0
votes
3 answers

Fix circular dependency in arithmetic class

I have a set of classes implementing the curiously recurring template pattern. However, the trick is that the base class needs to return instances of the subclasses. Here's an example: template class ArithmeticBase { public: …
Joel
  • 2,654
  • 6
  • 31
  • 46
0
votes
1 answer

Stack overflow created by a cycle in code with singletons

I have two singleton classes, lets call them class A and class B. The classes look like such. class A { private static A instance; private A(int timeout) { init(); } public static A getInstance(int timeout) { …
jgr208
  • 2,896
  • 9
  • 36
  • 64
0
votes
0 answers

Circular dependency in Python how to solve it?

Here's the structure of my project: MyProject | |---- package1 | | | |---- classA needs classXYZ | |-----classB needs classXYZ | |-----classC | |-----package2 | | | |-----classXYZ (path creator) | |-----package3 |…
mirx
  • 606
  • 1
  • 9
  • 21
0
votes
1 answer

What is the best way to break circular dependency between GameFlow and Controller in a game?

For example, I want to create a game, which has a GameFlow to control the game event flow, also I have some controllers (e.g.:PlayerAttackController,EnemyControllerController) for different flow. GameFlow used to switch controllers, controllers…
ggrr
  • 7,737
  • 5
  • 31
  • 53
0
votes
1 answer

Objective C, Swift Interoperability issue due to circular dependency

I'm working on an iOS project that was done few years back in Objective C. So I've to implement some new features to the existing one, so this time I'm using Swift for that purpose. I've added a new Swift class: class CampView: UIView { //…
Midhun MP
  • 103,496
  • 31
  • 153
  • 200
0
votes
2 answers

How to break circular dependency in knockout model subscriber?

I am building models using Knockout. I have one parent model and couple of children. Each children has obsevrable (computed in working codem but it does not changes situation) isLoading which return true when any internal operation inside model…
Alex G.P.
  • 9,609
  • 6
  • 46
  • 81
0
votes
2 answers

Why can't a header file Head1.h include a header file Head2.h that includes Head1.h?

For example, I want two header files which can depend on a function from the other header file. //Header1.h file #include Header2.h void h1(){ //... func1(); } void h2(); //Header2.h file #include Header1.h void func1(); void func2(){ //some…
Ren
  • 443
  • 1
  • 3
  • 14
0
votes
1 answer

How do I register decorators with AutoFixture?

The Decorator pattern demonstrates how we can extend the behaviour of a component without modifying the underlying implementation. But this means I have two components that implement the same interface. Is there a way to Register these in…
0
votes
1 answer

Circular dependency issue - Python

I am a newbie to Python, and I have an issue that I believe is due to circular dependencies, but I have been unable to resolve it. How can I figure out where the circular dependency is occurring, and what can I do to resolve this error (please find…
SulfoCyaNate
  • 396
  • 1
  • 2
  • 19
0
votes
1 answer

Doctrine entity and Zf2 module dependancy

I have 2 modules. Config with ConfigEntity and Reporting with ReportingEntity Those entities have a oneToManyRelation: class Config { public function __construct() { $this->reportings = new ArrayCollection(); } /** *…
Greco Jonathan
  • 2,517
  • 2
  • 29
  • 54