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

Breaking cyclic dependency in constructor

I'm writing a Java class to manage a hex map (class GameMapImpl implements GameMap) that contains Cell objects. Cell objects are saved in a HashMap, where the key is the position on the hex map. The whole thing used to be very tightly…
user5008307
0
votes
1 answer

Circular dependencies in C++ that use member functions

I realize this question has been asked many times and the solution is usually forward declarations. However, if I am correct, forward declarations can't be used when member functions are being used in that file. I have a circular dependency that I'm…
epitaque
  • 73
  • 3
  • 9
0
votes
2 answers

Why can't I import from a python file one up from existing package?

In a website I'm building with Flask I've got structure like this: ├── app │   ├── __init__.py │   ├── models.py │   ├── ticket_scanner │   │   ├── __init__.py │   │   └── filehelper.py │   ├── templates │   │   └── all the templates are here.. │  …
kramer65
  • 50,427
  • 120
  • 308
  • 488
0
votes
2 answers

How can I resolve a circular class dependency when forward declaration is not possible as elegantly as possible?

I have something like this: struct v_with_holder { // bunch of fields holder h; // does not name a type }; typedef boost::variant struct_v; class holder { public: std::vector ss;…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
0
votes
0 answers

How to handle cyclic dependencies

I'm having some trouble with cyclic dependencies. Imagine the following sample classes: A class A with instance variables of types C and D and a method that uses these 2 types inside plus another type D: #include "B.h" #include "C.h" #include…
fc67
  • 409
  • 5
  • 17
0
votes
1 answer

Handling Jackson circular dependencies using a context stack instead of using JsonIdentityInfo, or JsonBackReference & JsonManagedReference

I am using Jackson to serialize JSON, but my JSON clients are not Java, and don't use Jackson. I want to avoid circular reference serialization infinite recursion by, whenever serializing a whole bean would cause an infinite recursion, serializing…
XDR
  • 4,070
  • 3
  • 30
  • 54
0
votes
1 answer

Visual Studio 2013 building order fails with parallels build

I have a Visual studio solution with multiple projects Let say project Core, CoreExtended, ProjectA and ProjectB. -- CoreExtended has as dependency Core. -- Project A and ProjectB have as dependencies CoreExtended an also Core. When i try to Build…
isra60
  • 512
  • 1
  • 6
  • 18
0
votes
1 answer

circular dependency in spring using @Autowired

I've been facing the problem of Circular dependency in spring. Public class UserServiceImpl implements UserService{ @Autowired private RoleService roleService; } Public class RoleServiceImpl implements RoleService{ @Autowired private…
Suyash Soni
  • 219
  • 2
  • 9
0
votes
2 answers

Restructuring my application

I am handling a project which needs restructuring set of projects belonging to a website. Also it has tightly coupled dependency between web application and the dependent project referenced. Kindly help me with some ideas and tools on how the calls…
Dilip
  • 474
  • 2
  • 8
  • 18
0
votes
1 answer

undeclared identifier: header included, not circular

I made sure that there is no circular dependency and that the header files are included in hopes of getting the compiler to understand everything but I was wrong Edit1: ALso have header guards like pragma once Edit 2: forgot to add in all the header…
0
votes
1 answer

circular class dependency within template member

#ifndef CLASSB #define CLASSB #include "ClassA.h" namespace name { class ClassB { public: static Handle conn(); }; } #endif - #include "ClassB.h" Handle name::ClassB::conn() { return getHandle(ClassA::it().str()); } - #ifndef…
user32323
  • 299
  • 1
  • 3
  • 11
0
votes
1 answer

make Circular dependency dropped (depending on executive file?)

Why do i get dependency dropping error in this code? There must be a problem inside it but I couldnt find this problem! Here I have automatic dependency generator. Here I have automatic dependency generator. Without the last line: -include…
ar2015
  • 5,558
  • 8
  • 53
  • 110
0
votes
0 answers

Circular dependency inevitable

I am developing an application in C++. In this app, I have two classes: database class and user class. Database class contains a list of pointers to users. In this class, I need to access to user's pointer to save information about users in an…
KiraLive
  • 23
  • 5
0
votes
1 answer

Circular reference while setting up bidirectional communication line between two remote objects

I'm using .Net remoting to set up a bidirectional communication line between two objects. The basic structure is as follows: Instances of RemoteObjectA call methods on StaticObjectA. Instances of RemoteObjectB call methods on…
mphair
  • 1,450
  • 2
  • 9
  • 15
0
votes
2 answers

requirejs returns undefined without dependency

On some occasions, requirejs returns an undefined object to my module. I've looked at a number of posts and most of the answer are related to circular dependencies. However I could find none (I have checked several times). I apologize by advance for…
Guig
  • 9,891
  • 7
  • 64
  • 126