Questions tagged [circular-reference]

A circular reference is a series of references where the last object references the first, resulting in a closed loop.

A circular reference is a series of references where the last object references the first, resulting in a closed loop.

Circular references can appear in computer programming when one piece of code requires the result from another, but that code needs the result from the first.

Information is taken from Wikipedia, more information available there.

758 questions
9
votes
3 answers

Circular reference and constructors

I'm trying to build an Attribute that validates a certain instance of a type. In order to do this I have to cast the ObjectInstance to that type. And I need to set the attribute on the member of that type. So we need to resort to the and keyword…
Anemoia
  • 7,928
  • 7
  • 46
  • 71
9
votes
3 answers

Learning Haskell: Seemingly Circular Program - Please help explain

I'm currently going through the book "The Haskell Road to Logic, Math, and Programming" by Doets and Van Eijck. I've never been exposed to any functional programming language until this book, so keep that in mind. Still early in the book, it gives…
9
votes
5 answers

Circular reference among two .net assemblies

I have two assemblies A & B. A has existing reference to B and it must be kept that way. Right now I made some changes to B that need to refer to A. So circular reference occurs. Bit of details: A has a few property grids that the dialog in B needs…
Lys
  • 591
  • 2
  • 9
  • 19
9
votes
1 answer

Visual Studio 2012 - Find Circular References Efficiently

Currently if I want to check for circular references inside a solution I select Architecture - Generate Dependency Graph - For Solution. Then from the new tab that opens I select Layout - Analyzers - Circular References Analyzer. Finally if I drill…
8
votes
1 answer

ninject memory leak due to circular scope callback reference

We had a major outage today in production where memory was disappearing very quickly from our webservers. This was traced back to a caching mechanism in Ninject (I think it was Activation Cache or something - not totally sure). After investigating…
8
votes
1 answer

How to fix procedure circular reference?

I'm new in the Delphi programming scene and i have trouble calling a procedure in a procedure in my console application. My simple application is for a item inventory running through a telnet server on windows. I'm using a old thinkpad as my…
ELCouz
  • 572
  • 2
  • 6
  • 17
8
votes
3 answers

What's a ""?

As per the topic, I couldn't find anything specific about this on the internet. What is in the output I get before the class name even though I call the property "tree"? Reference... to what, and why if I call property? And how to fix…
TheTanadu
  • 554
  • 1
  • 7
  • 33
8
votes
3 answers

Javascript memory leaks: why would assigning object to null work?

Can someone scratch an itch for me in regards to the nature of assignment-to-null fix used to prevent memory leaks? We are all familiar with the following technique to stop the circular reference between the DOM object and the JS object, in order to…
SZR
  • 81
  • 1
  • 3
8
votes
3 answers

How to hash and check for equality of objects with circular references

I have a cyclic graph-like structure that is represented by Node objects. A Node is either a scalar value (leaf) or a list of n>=1 Nodes (inner node). Because of the possible circular references, I cannot simply use a recursive HashCode() function,…
mfya
  • 352
  • 4
  • 9
8
votes
2 answers

A circular reference has been detected in Symfony

I run into problem tied to circular reference in Symfony, that I suspect to be caused by the serializer but I haven't found any answers yet. Here are the entities that I've created, the route and the controller. Any suggestions in this regard will…
Ruslan Poltaev
  • 91
  • 1
  • 1
  • 5
8
votes
1 answer

Are there any static analysis tools that can help detect shared_ptr<> circular references?

Are there any static analysis tools that can help detect shared_ptr<> circular references? Even if such a tool couldn't detect complicated cases, it would still be useful for eliminating the simple cases.
dicroce
  • 45,396
  • 28
  • 101
  • 140
8
votes
2 answers

Why is circular dependency allowed with namespaces in c#?

In c# you're allowed to have a statement in file a.cs (which has namespace of MyApp.A): using MyApp.B; while file b.cs (which has namespace of MyApp.B) already have the statement using MyApp.A; If a similar dependency would exist in different…
BornToCode
  • 9,495
  • 9
  • 66
  • 83
8
votes
3 answers

.NET Assembly References going all circular on me

Update: Last night, I decided that this is just too much work to change the folder where some reports are saved. My work-around here is to rename the folder, run the batch job I need done, and then change the folder name back to what it was…
Nick
  • 81
  • 3
8
votes
3 answers

Passing an object with circular references from server to client-side Javascript while retaining circularity

I'm trying to pass an object with circular references from node.js server to client-side javascript. Server (node.js): var object = { circular: object } //.... app.get('/', function(req, res){ res.render('index.jade', {object:…
laggingreflex
  • 32,948
  • 35
  • 141
  • 196
8
votes
2 answers

Is there a JavaScript (client-side) JSON library that integrates well with JSON.NET (server-side) and supports the "preserve references" feature?

JSON.NET supports circular reference serialization by preserving all references with the following settings: JsonSerializerSettings settings = new JsonSerializerSettings(); settings.ReferenceLoopHandling =…
Triynko
  • 18,766
  • 21
  • 107
  • 173