Questions tagged [cyclic-reference]

A cyclic reference is established if object A holds a reference to B while B holds a reference to A.

A cyclic reference is established if object A holds a reference to B while B holds a reference to A. This exposes a dynamic problem ("hen-vs-egg"), for instance in a programming language, to create a cyclic reference, A and B must be known prior to establishing their inter-relationship. Thus a form of temporal sequence (delay) is needed if data structures are purely functional, for example by declaring the initialization of the references lazy. Cyclic references can also pose problems to garbage collection which needs to detect that none of two objects involved in a cyclic reference are reachable any more by the rest of the code.

143 questions
1
vote
1 answer

Maven cyclic dependency when compling tests only - how to resolve easily?

I am working on modernizing an older project to be used with Maven. The project is very large and has around 30 modules in it. As far as the main source code is concerned, I managed to get all of it to compile and establish the dependencies…
egervari
  • 22,372
  • 32
  • 121
  • 175
0
votes
1 answer

Cyclic references using POCO entities and Silverlight services

I have created several POCO entities that have relationships between them. For instance, the "Individual" entity has a OneToMany relationship with a "Collection" entity. Here is how I defined them…
Michael Gallego
  • 1,746
  • 1
  • 20
  • 29
0
votes
1 answer

django: register listeners in models.py and cyclic import problems

I'm working on some signal listeners, which creates records from a model. And in django docs it is said listeners should be registered in models.py. Because the listeners are quite big in lines, I would like to separate their logics from the file of…
Xun Yang
  • 4,209
  • 8
  • 39
  • 68
0
votes
1 answer

MongoDb C# Driver support Cyclic references?

I was looking at porting a small side project over to use Mongo, as it was getting more and more time consuming using Nhibernate for the current scenario. I gave NoRM a try originally, and that had a branch which had support from cyclic references…
Grofit
  • 17,693
  • 24
  • 96
  • 176
0
votes
2 answers

Expression.Error: A cyclic reference was encountered during evaluation. - using custom function NetWorkDays in Power Query

I have created a custom function from a blank query to calculate the number of days excluding holidays and the weekends, the function is below Query1 = (StartDate as date, EndDate as date) as number => let DateList = List.Dates(StartDate,…
MaydayMayday
  • 1
  • 1
  • 2
0
votes
0 answers

How do I import shared components from Libraries in Angular in a module from another library

I am stuck. My situation: Lib UI has an icon component. Lib UI has a modal module. App has a shared module for root. I want to use the icon in the shared module and this is also needed inside the modal module that I want to use. The icon is used…
Ron Jonk
  • 706
  • 6
  • 16
0
votes
1 answer

How to find if object is assigned inside the same object? cyclic redundancy

var person = { name:'asdfds', key:1 } person.next = person; How to fix this cyclic redundancy in javascript?
Madhu
  • 132
  • 3
  • 10
0
votes
2 answers

How to ensure that S3 upload triggers a lambda function, but copying data within the same bucket does not trigger the lambda function anymore?

Required procedure: Someone does an upload to an S3 bucket. This triggers a Lambda function that does some processing on the uploaded file(s). Processed objects are now copied into a "processed" folder within the same bucket. The copy-operation in…
and0r
  • 305
  • 1
  • 4
  • 13
0
votes
2 answers

Ignore Parent Object to be sent in the JSON response - Cyclic Problem - JPA

Please be patient with me. tried my best to explain with sample easy code. Two Entities - Shop and Product. Relationship - A Shop can have many Product. I return a Shop object, it keeps printing like this - { "shopId": 1, "shopName": "S1", …
0
votes
2 answers

PowerQuery Expression.Error: A cyclic reference was encountered during evaluation

Can't find the error in formula - the value is calculated throughout the column (when keeping errors - no rows shown), but I can't apply the changes though.(( if [Index] > 0 then if articles_pivot{[Index]-1}[IN] <> null (when omitted the error…
Elina
  • 23
  • 6
0
votes
1 answer

How to refactor to avoid cyclic dependencies when methods are recursive?

I have written code to cast the object to the required type. And if the required type is a custom class object and it has another object we need to cast it recursively. BTW: I will know that I need to construct an object if the input is a hashMap.…
java_enthu
  • 2,279
  • 7
  • 44
  • 74
0
votes
1 answer

How to handle NSOutlineViewDataSource with loops

I have an NSOutlineView populated from an NSOutlineViewDataSource which is a thin wrapper over a supplied object model, containing a mixture of arrays, dictionaries and primitive types. However the object model has loops in its hierarchy. I thought…
silicontrip
  • 906
  • 7
  • 23
0
votes
1 answer

How do you instantiate classes with cyclic references to each other without having to use `NULL` in Java?

Suppose that you have the following classes which are perfectly legal in Java. class Ping { Pong value; Ping(Pong value) { this.value = value; } } class Pong { Ping value; Pong(Ping value) { this.value = value; } } Is there any way…
Microtribute
  • 962
  • 10
  • 24
0
votes
2 answers

Breaking cyclic references more elegant in C++

I have gotten many cyclic dependencies recently when my header files includes each other. See also here: What are forward declarations in C++? I actually do not get totally why its a cycle. When the compiler looks inside the header-file of the…
muella91
  • 189
  • 1
  • 2
  • 12
0
votes
1 answer

JDK13 Garbage Collection Not Working Correctly. Some of the de-referenced objects not being garbage collected

*The implementation module is not being garbage collected after it is de-reference in UI module. I have overridden finalize method in all the classes of implementation. finalize method of none of the objects being called after dereferencing. No…
krishna T
  • 425
  • 4
  • 14