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
3 answers

Dealing with circular includes in the context of circular references

As a follow up to an older question of mine, I wish to implement a client-server mockup simulation, where the client initiates a sequence of actions that involve calling methods on the server, which, in turn, can call methods on the client (let's…
0
votes
1 answer

JPA2 structuring OneToOne and OneToMany in the same class

Could you please tell me how you I might structure the following table/classes to avoid circular references? I have the following defined in a "Bachelor" degree class: @Entity public class Bachelor { ... @OneToOne(cascade = CascadeType.ALL,…
Novarse
  • 51
  • 1
  • 10
0
votes
2 answers

JuiceUI Dialog Post Back Script Error: Circular reference in value argument not supported

I am getting a strange script error on post back if I have a JuiceUI Dialog control on the page, regardless if it is used or not. I can't find anything out there on this, so I am sure that I am doing something wrong. Can any one provide any help? …
Brian Tax
  • 81
  • 7
0
votes
3 answers

Java Swing layout manager circular reference being set twice

Can anybody explain why circular reference is being set twice in the followig code? //declare panel this.cntnrPnl = new JPanel(); //define layout manager for the panel - but why circ ref? this.cntnrPnl.setLayout(new BoxLayout(this.cntnrPnl,…
amphibient
  • 29,770
  • 54
  • 146
  • 240
0
votes
1 answer

Symfony2.1 Circular references

I'm wondering how to avoid having a circular reference in my symfony2.1 application. I have an entity like customer ( name addresses -- OneToMany currentAddress -- OneToOne ) and address ( street customer -- ManyToOne ) Now my fixtures…
Thomas
  • 671
  • 7
  • 13
0
votes
1 answer

How does one handle a circular reference in javascript similar to the way that Excel provides an iteration limit?

I have an excel spreadsheet with a circular reference. By default, Excel will not calculate the cell. However, you can override this default behavior and force it to calculate a cell with a circular reference. You just need to set the number of…
technoTarek
  • 3,218
  • 2
  • 21
  • 25
0
votes
1 answer

Changing module variables after import

SO pyton gurus! I've just found an astonishing phenomenon that I don't understand. The problem can be best shown as code: #== kid.py ==# import dad def spam (): dad.spam() #== dad.py ==# import kid x = 1 print "body", x x = 2 def spam (): …
h2kyeong
  • 447
  • 3
  • 13
0
votes
1 answer

OOD - How to desing and structure the projects to avoid redeploying the main Application (factory pattern?)

I would like to check if my understanding in using and implementing factory pattern. Say I am designing an Application to play several Games (chess, poker). The games are loaded from one of the following sources: CSV, XML but I want the ability to…
0
votes
1 answer

Can anyone tell me why this would be a circular reference? Or at least point me to what a circular reference is?

I have this code snippet, which works great somewhere else, but gives me a circular reference error when I move it to a different section. I can't even find a good reference on what a circular reference is anywhere. // Create a new array to hold…
Warren J Thompson
  • 408
  • 1
  • 7
  • 19
0
votes
5 answers

Comparing circular linkedlists equals method

public class LinkedList { Object contents; LinkedList next = null; public boolean equals(Object item) { return (this == item) || ((item instanceof LinkedList) && this.equals((LinkedList)item)); } public boolean equals(LinkedList item) {…
bouncingHippo
  • 5,940
  • 21
  • 67
  • 107
0
votes
4 answers

How to resolve circular dependency when using composition?

I came across some situation like shown below, where each class needs the other class and it creates the cyclic dependency. I came across this type of situation while wrapping some C code using ctypes. There already are lots of post on this topic…
0
votes
3 answers

How to prevent circular reference in MVVM when using DispatcherObject.Dispatcher

The below code is very simplified. I'm trying to abstract a dispatcher context so my view models can synchronize events that can only be raised on the GUI thread. There's a circular reference in this pattern. Is there any other way to create a…
qxn
  • 17,162
  • 3
  • 49
  • 72
0
votes
3 answers

Creating a circular reference

I need to create several objects that have (often circular) references to each other. In general, several objects might be involved, but here's one simple case where I need just a pair of cars that refer to each other: class Car: def…
max
  • 49,282
  • 56
  • 208
  • 355
-1
votes
1 answer

Why does this code create a circular reference?

First, thanks for your Help for _ in 0..
-1
votes
2 answers

Find 'most clicked' variant in an array of objects, given a nested array of variants in Javascript

I have an array of objects called articles. An article has 3 important properties. name, clicks, and variants. The variants property is also an array of objects that contain name (It corresponds to an article in the array articles). What is the most…