circular dependency is a relation between two or more modules which either directly or indirectly depend on each other to function properly.
Questions tagged [circular-dependency]
1693 questions
6
votes
1 answer
Circular dependency issue with Typescript, CommonJS & Browserify
I'm in the process of moving a fairly large typescript project from internal modules to external modules. I do this because I want to create one core bundle, which, if and when required, can load other bundles. A seccond requirement which I'm…

Flion
- 10,468
- 13
- 48
- 68
6
votes
3 answers
Maven parent POM: Circular dependencies
We have a modular project with about 10 artifacts:
parent
+- artifact1
+- artifact2
+- artifact3
+- ...
+- artifact10
Furthermore, some of the artifacts have dependencies among each other:
artifact1
+-> artifact2
+-> artifact3
+-> ...
+->…

Alexander Müller
- 547
- 9
- 25
6
votes
2 answers
How to initialize const circular reference members
For example, I have two classes
class Foo;
class Bar;
class Foo {
const Bar &m_bar;
...
};
class Bar {
const Foo &m_foo;
...
};
Let foo is object of Foo and bar is object of Bar. Is there any way (normal or "hacking") to create/initialize…

Loom
- 9,768
- 22
- 60
- 112
6
votes
3 answers
Circular dependency between JavaScript Class and jQuery object
I'm trying to take an existing working code base and make it object oriented using JavaScript. My system takes JSON containing groups and items in a one-to-many relationship, and visualizes this on a page. The items can be moved into different…

Ian Clark
- 9,237
- 4
- 32
- 49
6
votes
3 answers
CDI injection loop
I'm running into a issue with CDI Injection into a Weld container in JBoss 7.1.1
I've got the following object model :
@Stateless
class ServiceEjb {
@Inject
A a;
}
class A {
@Inject
B b;
}
class B {
@Inject
A a;
}
When trying to inject A or B in…

jmcollin92
- 2,896
- 6
- 27
- 49
6
votes
3 answers
Depedency injection: injecting partially-initialized objects
This question is about Unity Container but I guess it is applicable to any dependency container.
I have two classes with circular dependencies:
class FirstClass
{
[Dependency]
public SecondClass Second { get; set; }
}
class SecondClass
{
…

Konstantin Spirin
- 20,609
- 15
- 72
- 90
6
votes
1 answer
Curious circular inheritance with mix-ins in C++
What is a good way to unscramble the circular inheritance here?
class Node {
// ...
public:
list neighbors() { /* ... */ }
void update() { }
}
template
class HasImportance : public virtual NodeType {
double…

Ben Kovitz
- 4,920
- 1
- 22
- 50
6
votes
4 answers
Resolving Maven circular dependencies between test, testhelper, and project-under-test
my set up is this. I have project A, and a test project depending on A:
A <- A_t
I also have other projects depending on A (and their tests):
A <- B <- B_t
To simplify some of the testing I introduce a new library helping test stuff based on A:
A…

Bjarke Freund-Hansen
- 28,728
- 25
- 92
- 135
5
votes
2 answers
Circular Dependencies Amongst DLL's
What are the 'best' practices regarding circular dependencies amongst DLL's in .net?
I am trying to work on a DLL for error handling/logging that needs to read/write XML.
I already have several classes to help with XML manipulation in a seperate…

ChandlerPelhams
- 1,648
- 4
- 38
- 56
5
votes
0 answers
How to do double referencing in mongoose schema in Nestjs without forming a circular dependency?
author.module.ts
@Module({
imports: [
forwardRef(() => ArticleModule),
MongooseModule.forFeature([{ name: Author.name, schema: AuthorSchema }]),
],
controllers: [AuthorController],
providers: [AuthorService, AuthorsRepository,…

Harshit Jain
- 51
- 1
5
votes
2 answers
NG3003: Angular 12 Circular Dependency in library - Ivy partial compilationMode
I have an issue presented here.
I have a ParentComponent which has a child ChildComponent,
and child has ParentComponent inside of it so there is a cycle here.
This is the error I'm facing:
✖ Compiling with Angular sources in Ivy partial compilation…

Shadowalker
- 402
- 1
- 7
- 17
5
votes
2 answers
Arm Template (Bicep): Circular Dependency when merging appsettings (list function)
I'm trying to update the AppSettings of an App Service through a bicep file.
When doing this in my bicep template:
var currentAppSettings = list('Microsoft.Web/sites/appServiceName/config/appsettings', '2018-11-01')
var newAppSettings = {
test:…

Peter Wyss
- 395
- 2
- 16
5
votes
1 answer
How to error the ng build command when circular dependencies detected
I'm using Angular 9 and I would like my builds to to fail whenever the circular dependency is detected in the build target.
When I was using Angular 6 and below, I was just adding a Circular Dependency Webkack plugin…

leszczu450
- 241
- 2
- 11
5
votes
2 answers
How to handle circular references with Autofac 2.4.5?
The autofac wiki page about Circular References says to use:
cb.Register().OnActivated(ActivatedHandler.InjectUnsetProperties);
But it looks like ActivatedHandler does not exist anymore in 2.4.5. Digging around in the source, I found…

Ants
- 2,628
- 22
- 35
5
votes
2 answers
Importing model classes from other apps without causing circular reference in Django
I have 3 apps products, sales, purchases. each app has a correspondingly named Model class, Product, Sale, and Purchase.
products/models.py
class Product(models.Model):
Name = models.CharField(max_length=32)
sales/models.py
class…

Selman Hassen
- 105
- 4