Questions tagged [cyclic-dependency]

Cyclic Dependency occurs when objects form an infinite recurring dependency graph. The head points to the tail and the tail points to the head.

123 questions
0
votes
0 answers

how to clean up a Python package import statements

So I decided to clean up my package, which has many modules. To that end I commented every single module import statement, and then when running the code I was just loading what I needed. However, this quickly became a nightmare where I find myself…
aaragon
  • 2,314
  • 4
  • 26
  • 60
0
votes
3 answers

Mutual recursion between objects in Python

I'm currently working on a module that allows users to build an arbitrary task network model (for use in a discrete event simulation) by creating instances of task objects (my module provides a task class). Among other things, a task contains logic…
0
votes
0 answers

How to resolve cyclical dependency in Angular 2 providers

I have multiple different services that extend another service: BaseService { display(message: string): void { } } BetterService { constructor(private base: BaseService) { } display(message: string): void { …
Ivan Zyranau
  • 879
  • 2
  • 14
  • 33
0
votes
1 answer

Maven cyclic dependency issue for Spring project

I have a Spring project which contains ~50 components. Unfortunately, one of the classes caused an issue of cyclic dependency in Maven. Here's the story: I added a new component to my Spring project. Let's call it Apple for now. It has a @Bean…
Jerry Yeh
  • 61
  • 1
  • 3
0
votes
1 answer

Function uses object and object uses function

I essentially have a cyclic dependency problem where a function uses an object object and the object uses said function. Is there any way to resolve this without working around it? //function that uses struct void change_weight(Potato* potato,float…
0
votes
2 answers

How to break and improve cyclic dependency without using proxy pattern?

My classes are depending upon too many other classes and I couldnot find ways to improve it. The problem goes something like below: I have a ProductRepo, ProductFactory and a ImageFactory classes. ProductRepo does the db thing on products table and…
Laxman
  • 1,149
  • 2
  • 11
  • 17
0
votes
1 answer

Not a class, namespace or enumeration?

My teacher got me a code to study and I can't figure out when I typedef the map (as i commented in the code) it works fine but when I define without typedef it doesn't seems to work. If someone could be kind to explain I would be grateful! I read…
0
votes
2 answers

Detect Cyclic Dependancy in Hashmap in Java

I have a hashmap of: Tables => Set of Parent Tables [ HashMap> ] Example of non-cyclic case could be: A -> [B,C] D -> [B,C] B -> [C] c -> [] Example of cyclic case would be: A -> [B,C] B -> [C] C -> [A] I want to reject…
lostcoderx
  • 27
  • 5
0
votes
1 answer

Cyclic Dependency Issue with Class inside Namespace

I am having a cyclic dependency issue. I have two header files and they each depend on each other. The issue I am having has to do with a class in a namespace. File #1 class Player; // This is how I forward declare another class namespace sef…
code
  • 5,294
  • 16
  • 62
  • 113
0
votes
4 answers

C++ Errors: " 'class' does not name a type" and "invalid use of incomplete type ‘struct ...' "

Here is a very repetitive issue, also here in StackOverflow, but I do not manage to solve my problem even trying the different answers. So, I have some classes: main.cpp: #include "foo.h" #include "bar.h" ... foo.h: #include "bar.h" class foo { …
makeMonday
  • 2,303
  • 4
  • 25
  • 43
0
votes
1 answer

Cyclic Dependency between Infrastructure and Model Layers/projects of DDD

I am following a book for Domain Driven Model in C#.NEt. I am having Cyclic Dependency between Infrastructure and Domain Layer (both are class library project of my solution namely "ShareManagement"). I want to know how can I get rid of cyclic…
Fakhar Anwar
  • 295
  • 1
  • 3
  • 20
0
votes
4 answers

C++ Classes dependent on each other causing a cyclic dependency error

My searches have lead me to believe that the problem I am experiencing is called cyclic redundancy. I don't understand any of the solutions that are posted. I am (fairly) new to C++, coming from a strong Java background. Basically there are two…
user2218509
  • 53
  • 1
  • 6
0
votes
1 answer

JAVA/JNI - Load native DLL with circular dependency

I try to load C++ code in my Java project with JNI. I have many several DLL to load, and unfortunately there is a cyclic dependency between two of them: dll A needs dll B which in turn needs dll A! I know it is a bad programming design to have…
-1
votes
2 answers

How to manage cyclic dependencies when have interface and its implementation in different packages

I have my project structure looks like this: Structure of code: hypervisor ├── hypervisor.go ├── hyperv │   └── hyperv.go └── virtualbox ├── vbox.go └── vboxprops.go Source code: //hypervisor/hypervisor.go package hypervisor type…
Muhammad Hewedy
  • 29,102
  • 44
  • 127
  • 219
-1
votes
1 answer

How do I solve this Stack Over Flow Error?

I am struggling to solve this StackOverFlow exception when I try to run my TicTacToe program. From reading the stack trace I know that the StackOverFlow error is the result of a cyclic relationship. This is because when I instantiate the miniFrame…
1 2 3
8
9