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

Circular imports and annotations

If I want to use annotations in both classes in the different modules is cross? from BModule import B class A: def method(self, b: B): pass ~ from AModule import A class B: def method(self, a: A): pass I got a ImportError: cannot…
0
votes
1 answer

Lifetime of dependent classses in C++?

I have a class A that provides methods to construct instances of class B. And B holds a private reference to A and provides a constructor to set this reference. class A { public: B* construct_B (); } class B { private: const A&…
0
votes
1 answer

If I cant eliminate circular references, then they should be in one class?

a SQL implementation: abstract class SQL { abstract public function connect(); abstract public function query($sql); abstract public function queryAndReturn($sql); abstract public function startTransaction(); abstract public…
John Smith
  • 6,129
  • 12
  • 68
  • 123
0
votes
1 answer

Maven: Non-resolvable import POM from other module

It is something likes Maven: Non-resolvable parent POM but not the same. I have a parent pom group parent SNAPSHOT pom module1
0
votes
1 answer

Resolving Circular Dependency with a Library Class

In my current project, I have Actors that want to move around in an environment. Different Actors may have different movement Strategies, and I am injecting the Strategies as dependencies into the Actors as follows (language-independent): actor =…
0
votes
1 answer

Avoiding Circular Dependencies in Class Definitions in C++

I currently have two classes: foo and bar. Foo uses instances of bar in one of its methods, and bar uses an instance of foo in its constructor. However, this will not compile. I understand that there is a circular dependence, so I tried to break out…
AlgorithmsX
  • 307
  • 2
  • 10
0
votes
1 answer

Why is my function causing a TypeError is not a function?

I am calling a function that appears to obviously be a function, but I keep getting TypeError: [function name] is not a function. Here is a minimal example to reproduce the error. main.ts import someFunction from './someFunction' export const…
0
votes
2 answers

AngularJs resolving errors caused by circular JSON Structures

So I'm having issues with the following error: chartsuccessfulapploginsController.js:59 TypeError: Converting circular structure to JSON at Object.stringify (native) With this snippet of code, that retrieves data from a chart: var…
0
votes
1 answer

Circular dependency in template classes

I'm having trouble with a circular reference of types. For an implmentation of the following: // Parent.h template class EnclosingType { public: typename OtherType type_; }; class OtherType { public: EnclosingType &…
0
votes
1 answer

How to serialize entities that have a one-to-many relationship with Entity Framework?

I'm creating an ASP.NET Web API with Entity Framework following the Code First Approach. I have a very simple model, which consists of a one-to-many relationship between a House and a Room: House.cs public class House { public int ID { get; set;…
0
votes
0 answers

Clearing cached service container fails due to the cached service container

My question here boils down to whether what I'm doing in and of itself is wrong or whether I have discovered a bug. I'm simply not sure... What did I do? We have a relatively normal application based on Symfony 2.8. There, we also use the usual…
Ulrich Eckhardt
  • 662
  • 6
  • 14
0
votes
2 answers

Python: Convert Cyclical dictionary to JSON

I'm trying to convert a nested cyclical dictionary to JSON. I am getting an overflow error: In [8]: xx = json.dumps(d) --------------------------------------------------------------------------- OverflowError Traceback…
David Yang
  • 2,101
  • 13
  • 28
  • 46
0
votes
1 answer

Circular dependency angularjs

can anyone tell me where is the circular dependency in the following code? var homeApp = angular.module("homeApp",['ngAnimate', 'ui.bootstrap']); 'use strict'; homeApp.factory('AdminDashboardService', ['$http', '$q', function($http, $q){ …
Vish
  • 280
  • 2
  • 18
0
votes
2 answers

Circular Typedefs

This code fails to compile: class B; class A{ typedef int AThing; typedef B::BThing BThing; }; class B{ typedef int BThing; typedef A::Athing AThing; }; Because A needs a typedef from B and B needs one from A. What is the typical method for…
DarthRubik
  • 3,927
  • 1
  • 18
  • 54
0
votes
2 answers

Call WebView page method from referenced WinRT Component with AllowForWeb class

I have a XAML page with WebView inside (for example MainPage.xaml). Also I have WinRT Component with class marked with [AllowForWeb] attribute. This component is referenced from project where MainPage.xaml located and in code-behind…