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
1 answer

Cannot import name - can't see circular imports

I have a problem with my code. There are two files - scraper and parser. There is a very few imports in them but I'm still getting import error. from parser import parse_price ImportError: cannot import name parse_price I suppose it should be…
Milano
  • 18,048
  • 37
  • 153
  • 353
0
votes
2 answers

Why am I suffering Circular Dependency here?

Utilities.h #ifndef _UTILITIES_ #define _UTILITIES_ #include "MyFirstCairoPlugin.h" class PLUG_CLASS_NAME; class Utilities { private: PLUG_CLASS_NAME *pPlug; public: Utilities(PLUG_CLASS_NAME *plug); ~Utilities(); }; #endif //…
markzzz
  • 47,390
  • 120
  • 299
  • 507
0
votes
3 answers

Is this a case of circular reference? Should I avoid it?

In the following code I have two classes. When the Nation class is instantiated to an object, it also instantiates an object for the Population class with a reference to the nation object. class Nation def initialize(name) @name = name …
Redoman
  • 3,059
  • 3
  • 34
  • 62
0
votes
1 answer

Batch file to build two .net solutions with circular dependency

I have two solutions with multiple projects each. The two solutions utilize circular dependency to get a full build of the application. Basically 1. Build two projects from solution 1. 2. Build three projects from solution 2. 3. Build all solution…
todd.pund
  • 689
  • 2
  • 11
  • 36
0
votes
0 answers

Circular dependency error but type required for method?

Edit: I believe this question is not a copy of "resolve-header-include-circular-dependencies" and I would still like this one answered because I have difficulty understanding "resolve-header-include-circular-dependencies". I have a small problem…
0
votes
2 answers

C++ circular reference problem

I have 2 classes: DataObject and DataElement. DataObject holds pointers to (only) DataElements, and a DataElement contains pointers to several types, among which a DataObject. This used to be no problem, since I only use pointers to DataObjects in…
0
votes
0 answers

Does ES6 target allow typescript + systemjs to support circular references?

I know similar questions have been asked before (e.g., 1, 2). However, they do not mention ES6, which the systemjs docs imply is a solution to the problem (3). So my question is: If I tell the typescript compiler to target ES6 and emit "system"…
Chris
  • 4,734
  • 2
  • 19
  • 26
0
votes
3 answers

Avoid circular reference for classes

I have a function that creates and returns a "Person". The "Person" has a "Spouse" property which is, of course, another "Person". This causes an endless recursion since the "Person" being created is always a "new" one each time the function is…
Starfleet Security
  • 1,813
  • 3
  • 25
  • 31
0
votes
1 answer

Avoiding circular dependencies while maintaining "module" structure in express

I'm writing an express app in ES6 and the file structure I am using is grouping files by functionality. Each module has an index.js which is responsible for exporting any relevant methods, classes, etc. Other sibling modules only require the…
wlingke
  • 4,699
  • 4
  • 36
  • 52
0
votes
0 answers

Unity WebAPI circular dependency error

I am using Unity.WebAPI in my .net project to register and resolve dependencies. I have four projects, that are i) interfaces ii) UserService (Actual Implementation) iii) ProductService (Actual Implementation) iv) Web API Project which reference…
0
votes
1 answer

Circular dependency error configuring Spring Security with Spring Boot and Waffle

I am trying to configre Spring Security for my Spring Boot application using Waffle, but it is failing when I run my application. It is saying something about a circular dependency problem on waffleNegotiateSecurityFilter, but I don't understand it…
secondbreakfast
  • 4,194
  • 5
  • 47
  • 101
0
votes
1 answer

using a typedef from another class in a circular manner

This is a question to see the limits of the C++ language. Most circular class dependencies can be solved with forward declarations and pointers. But I wonder if this can be solved somehow: struct Y; // forward declaring Y does not solve the…
bolov
  • 72,283
  • 15
  • 145
  • 224
0
votes
0 answers

Manage runtime addons with maven

I have a maven project called Editor. I have several maven projects which are plugins for this Editor (real plugins, not maven plugins). I have no real dependency between the editor and the plugins. The editor find the plugins at runtime in the…
Xavier M.
  • 136
  • 1
  • 7
0
votes
2 answers

Circular Dependencies between C++ classes

I've read in this question that If you really have a model where A contains B and B contains A then these classes appear to be incapable of living without each other. In which case perhaps you only really have one class and not two. What would…
eclmist
  • 161
  • 1
  • 14
0
votes
1 answer

Objective c circular import in Singleton class

I have two singleton classes which are defined like that SingletonClassA.h @interface SingletonClassA : NSObject + (SingletonClassA*) sharedInstance; @end SingletonClassA.m #import "SingletonClassA.h" #import "SingletonClassB.h" …