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
0
votes
1 answer

Angular JS object circular dependancy

I have two objects, a House and a Tenant, both described and constructed in factory methods. For the purposes of the app, each Tenant may have more than one house and each House may have more than one tenant. Thus, each object needs to keep an array…
0
votes
0 answers

Issue with two objects that create each other, infinite loop

I have two objects, DNLocations, that have arrays of other locations inside of them. The idea i'm trying to get across is that you can go from one location to another, and back to the previous one. Unfortunately, when i create the locations like…
Evan Ward
  • 1,371
  • 2
  • 11
  • 23
0
votes
1 answer

How to detect circular references between assemblies in a .NET solution?

Do you know of an effective way to detect circular references between .Net assemblies? The situation I would like to detect/prevent is such as: A references B B references C C references A
Daniel Daranas
  • 22,454
  • 9
  • 63
  • 116
0
votes
0 answers

Maximum call Stack size error on circular reference object

I've an Object which contains circular references in it (references to DOM nodes). I've to save this object in local or session storage. To do this I was trying to do JSON.stringify and because of circular references I'm unable to stringify it.…
0
votes
2 answers

Optimal detection of circular reference in object (currently brute forcing)

I have a Product object, which can depend on other products. This dependency information is stored in a ServiceTemplate object. These dependencies can be chained (i use the arrow to indicate that 3 depends on 2, and 2 depends on 1): 1 <= 2 <= 3 I…
morleyc
  • 2,169
  • 10
  • 48
  • 108
0
votes
1 answer

getting rid of constructor circular dependency

It's my first time on StackOverflow and I hope my question isn't that noobish! I never actually tried to resolve this, I always used instead DI via setters methods instead of constructor, but It's now time to look for a better pattern! :) I tried to…
0
votes
1 answer

Selft referencing table in EntityFramework (Insert error)

I have the following entity: public class Category { public virtual long Id { get; set; } public string Name { get; set; } public virtual long ParentId { get; set; } public virtual Category Parent { get; set; } public virtual…
Raheel Khan
  • 14,205
  • 13
  • 80
  • 168
0
votes
1 answer

updating a MYSQL table value with a circular reference

I have two tables: AGENT -------- agent_id user_id ... and USER ----- user_id agent_id user_name ... I'm not here to discuss why this was done, but I have question regarding being able to update USER.AGENT_ID to the correct value if I only know…
NEW2WEB
  • 503
  • 2
  • 8
  • 22
0
votes
1 answer

Inconsistent results in iterative calculation of circular reference in Excel 2010

I have a circular reference with embedded VLOOKUP function which I solve using the iterative calculation. I have two adjacent columns that have same logic behind the circular reference and the iterative calculation is checked. However the results…
0
votes
1 answer

Circular relation one to many

I am having an issue with my database model. I am fairly new to this, thus sorry in advance. Here are how my auto generated classes look like... Session Model public partial class Session { public Session() { this.Tutors = new…
0
votes
1 answer

Where exactly did circular reference start when JSON.stringify throws the error?

Passing an object to JSON.stringify throws the error "Converting circular structure to JSON" but I'm not exactly sure why. I'm passing the object via server-side node.js app.get('/', function(req,res){ res.render('index.jade', {object:…
laggingreflex
  • 32,948
  • 35
  • 141
  • 196
0
votes
2 answers

JavaScript/GSON: Access JSON references dynamically over object graph (circular references)

I had the problem, to serialize my Java objects through Google GSON, because of several circular references. All my tries ended up in a StackOverflowException, because GSON is not able to handle those circular references. As a solution, I found…
Tunguska
  • 1,205
  • 3
  • 18
  • 37
0
votes
1 answer

Circular reference using IoC

I am using windsor castle as my IoC container, and has run in to a bit of a problem. First of all - i know about: Castle Windsor: How to prevent circular references in factory-created objects were the created objects refers back to the factory But…
LightCZ
  • 695
  • 1
  • 8
  • 20
0
votes
1 answer

Return DataSet through Json object dynamically

I have the following code: GenericManager gm = new GenericManager(); DataSet ds = new DataSet(); ds = gm.ExecuteQuery(gr.TableName, gr.ColumnName, gr.WhereClause); return Json(ds, JsonRequestBehavior.AllowGet); In which ExecuteQuery is the method…
HarshSharma
  • 630
  • 3
  • 9
  • 34
0
votes
2 answers

ISerializable Circular Reference

I've been trying to understand how to correctly implement a circular reference using the ISerializable interface. But i have not been able to work out even in a simple form, I have read the explanation here But I have not been able to implement…
TigerChan
  • 88
  • 1
  • 5