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

django how to insert into tables reference each other

I'm using django 1.6, and I have 2 models referencing each other like so: class Person(models.Model): address = models.ForeignKey('Address', blank=False) class Address(models.Model): person = models.ForeignKey(Person, blank=False) The reason…
0
votes
1 answer

Cyclic Dependency Issue with Class inside Namespace

I am having a cyclic dependency issue. I have two header files and they each depend on each other. The issue I am having has to do with a class in a namespace. File #1 class Player; // This is how I forward declare another class namespace sef…
code
  • 5,294
  • 16
  • 62
  • 113
0
votes
1 answer

How to solve this cycle dependency in c# project?

I am modifying a project (1) (windows service). I was given a utility project(2) and I am using this is my project. I dont know why but this (2) has an initialization using ConfigurationManager.AppSettings[] I use a custom config reader in my…
Dexters
  • 2,419
  • 6
  • 37
  • 57
0
votes
0 answers

WCF Cyclic Reference and can not solve with IsReference = true

I know that this question have asked a million times. But my case, I weird and I don't understand. I got a cyclic reference and below are my code/configuration: I have Entity as a base class for all entities. [DataContract(IsReference =…
Vu Nguyen
  • 3,605
  • 3
  • 22
  • 34
0
votes
2 answers

C++ class methods forward declaration

Is there any way to redeclare a class to define methods which where only declared this far? Eg. something like: class A { void a(); void b() {} } class A { void a() {} } instead of class A { void a(); void b() {} } A::a() {}…
dronus
  • 10,774
  • 8
  • 54
  • 80
0
votes
1 answer

Cyclic dependency issue in c# while trying to add references

I have two Class Libraries (Lets say LibA and LibB). LibA is using some fnctions of LibB so I add reference of LibB in LibA. Now LibB also needs to use some code of LibA. I cant add reference of LibA to LibB now because of cylic dependency thing.…
user2968369
  • 265
  • 1
  • 4
  • 10
0
votes
1 answer

Cyclic referencing doesn't seem work in event handler function

I have an object called paperClass (even though I know, classes don't exist in JavaScript). This is containing a reference to a divElement. Now, by hovering the divElement I want to get a reference to the paperClass object. I tried it the following…
donald
  • 7
  • 1
0
votes
1 answer

Circular dependency: why are these classes un-couplable

I have a class, Thing, which has a number of variables. I also have a class, FileHandler, which records data to log files. The FileHandler is specific to the instantiation of a Thing and needs to print several of the instance variables of Thing.…
user442920
  • 857
  • 4
  • 21
  • 49
0
votes
1 answer

C++ cyclical inheritance dependancy

Each of the following statements have include guards around them, for their corresponding header files. C extends B, things subclass B so they can get a pointer to A– but A has several fields that are subclasses of B. My current solution is to…
awiebe
  • 3,758
  • 4
  • 22
  • 33
0
votes
1 answer

"The referential relationship will result in a cyclical reference that is not allowed."

This is scenario one, which works fine: public class Domain { public int DomainId { get; set; } [InverseProperty("Domain")] public virtual ICollection Persons { get; set; } [InverseProperty("Domain")] public virtual…
sports
  • 7,851
  • 14
  • 72
  • 129
0
votes
1 answer

How to form a tree from data set with cyclic relations?

I have a class like this: class Foo { public String name = ""; public ArrayList children = new ArrayList(); } Now, I have about two thousand of these 'Foo' objects stored in ArrayList, and they are related to each other as you can…
manabreak
  • 5,415
  • 7
  • 39
  • 96
0
votes
4 answers

Trying to resolve circular reference error between my deque class and tree class

Could anyone help me resolve the circular reference errors I'm getting here. I've created my own deque class which is used by the breadthFirst method of FibTree. Below are the highlights from the separate Header and CPP files. There are issues with…
Alex2134
  • 557
  • 7
  • 22
0
votes
2 answers

Circular template reference structure

I have a ploblem about circular template reference. I want to make a tree using class node and class edge as following; template class node { public: std::vector edge_out; std::vector edge_in; }; template…
MooMoo
  • 1,086
  • 12
  • 22
0
votes
1 answer

How to avoid cycling call in Objective C?

Title itself is enough for my question I guess. However I will explain further here, consider I have a two view controller A and B. A is base and it is pushing B, In one situation I want the A to be intimated from B when one button is clicked in…
Newbee
  • 3,231
  • 7
  • 42
  • 74
0
votes
3 answers

Avoid cyclic references caused by C++ includes headers

I have 3 classes: A, B and C. C is #includeed by B, and B is #included by A. In class C i have defined a handler for a button, and when the button is pushed, C will PostMessage to object A. If i include A in C, i will have a cyclic reference, so…
MRM
  • 561
  • 5
  • 12
  • 29
1 2 3
9
10