circular-reference

What is the scale of PHP's circular reference problem and should I worry about it?

If I am using a tree structure of nodes similar to the code below, do I have to worry about the circular reference? I have read that PHP uses a memory allocation mechanism which can make life very hard for the garbage collector when there are circular references involved. What I want to know is: If my tree consists of only a few n...

Has anyone ever used AOP to detect a circular reference?

I don't know, so that you could throw a CircularReferenceException? ...

What solutions are there for circular references?

When using reference counting, what are possible solutions/techniques to deal with circular references? The most well-known solution is using weak references, however many articels about the subject imply that there are other methods as well, but keep repeating the weak-referencing example. Which makes me wonder, what are these other me...

I have a circular reference. How can I create a weak reference in Objective-C?

I have an object of class Row that needs to release numerous objects of the class Block. Every Block currently has a property that retains an instance variable of class Row. Every Row contains an NSMutableArray of these Blocks. I understand that this is a circular reference. Apple's documentation states that in order to deallocate an obj...

Is there a way to detect and debug circular references when using StructureMap?

Lately I've been using a larger number of smaller objects, because they are simpler and easier to reuse. Most of the time there isn't any problem injecting these objects into one another using StructureMap (great tool, btw). But occasionally, I f*** up, and I get myself a nice circular reference in the guise of a stack overflow excepti...

.net dottrace memory profiling usage questions - Filter Circular References

I use DotTrace as memory profiler. I wonder how it can filter circular incoming references? As for the scenarios that I want to see who the hell holds reference to my object and keep it alive, those circular references, especially event handlers are not of interest but the true bad reference is often hidden among them. Additionally, w...

django - circular import problem when executing a command

I'm developing a django application. Modules of importance to my problem are given below: globals.py --> contains constants that are used throughout the application. SITE_NAME and SITE_DOMAIN are two of those and are used to fill some strings. Here is how I define them: from django.contrib.sites.models import Site ... SITE_DOMAIN = Sit...

Forward declaration - no admin page in django?

Hi SO, This is probably a db design issue, but I couldn't figure out any better. Among several others, I have these models: class User(models.Model): name = models.CharField( max_length=40 ) # some fields omitted bands = models.ManyToManyField( Band ) and class Band(models.Model): creator = models.ForeignKey( User ) # some...

How to avoid circular unit reference?

Imagine the following two classes of a chess game: TChessBoard = class private FBoard : array [1..8, 1..8] of TChessPiece; ... end; TChessPiece = class abstract public procedure GetMoveTargets (BoardPos : TPoint; Board : TChessBoard; MoveTargetList : TList <TPoint>); ... end; I want the two classes to be defined in two separate ...

How did Microsoft create assemblies that have circular references?

In the .NET BCL there are circular references between: System.dll and System.Xml.dll System.dll and System.Configuration.dll System.Xml.dll and System.Configuration.dll Here's a screenshot from .NET Reflector that shows what I mean: How Microsoft created these assemblies is a mystery to me. Is a special compilation process requir...

Encountering self recursive assembly references in the .NET framework.

I was writing some C# code recursively walking the referenced assemblies of a base assembly, building up a directed acyclic graph of these references to do a topological sort. I'm doing this by means of the GetReferencedAssemblies() method on the Assembly class. While testing the code, I found - to my surprise - that some assemblies in ...

Resolving Circular References (C#)

I'm having a couple of problems with circular reference/dependency that I've been sitting on all day. Something must be wrong with my thought process, I just don't get it. Here are my projects: Flip.Main (ASP.NET MVC) Flip.Domain (C# DLL) Flip.Services (C# DLL) Flip.Utility (C# DLL) Current References/Dependencies: Flip.M...

Circular reference in C++ without pointers

Hi, Is there a way to define circular references without using pointers? I need to have somthing like this: struct A; struct B { A a; }; struct A { B b; }; Thanks! ...

How do I detect circular logic or recursion in a multi-levels references and dependencies.

I have a graph of multi-level dependecies like this, and I need to detect any circular reference in this graph. A = B B = C C = [D, B] D = [C, A] Somebody have a problem like this? Any solution??? Thanks and sorry by english. ========= updated ========== I had another situation. 1 2 = 1 3 = 2 4 = [2, 3] 5 = 4 In this case,...

How and when to appropriately use weakref in Python

I have some code where instances of classes have parent<->child references to each other, e.g.: class Node(object): def __init__(self): self.parent = None self.children = {} def AddChild(self, name, child): child.parent = self self.children[name] = child def Run(): root, c1, c2 = Node(), Node(), Node() root.AddC...

c# : Utility to find circular references / compile in correct order?

Hi there, doers anyone know of a good utility or program to interrogate a solution or a directory for all projects and tell you where circular references are and possible compile in order.. I remember see one a while ago but i can't find it anywhere.. ...

Nhibernate circular reference

I have a DomainObject with a property List<DomainObject> Connections{get;set;} So each object can be "connected" with others and I have to save this information in db to restore the entire graph on demand. Now I have a string property with the CSV of all Ids of DomainObject inside the Connections property but i'm not happy... There'...

Declare default parameter circular reference without pointers?

Is there any way to declare these classes in a header file without indirection? // Forwards declaration of B class B; class A { public: // Default parameter referring to B. May return its parameter const B& func(const B& b = B()); }; class B { public: // B ctors B() {} B(const B&) {} // B has A as a member ...

javascript, circular references and memory leaks

From what I recall of a not too distant past, Javascript interpreters suffered from memory leaking issues when faced with circular references. Is it still the case in the latest browsers? (e.g. Chrome, FF 3.5 etc) ...

Json and Circular Reference Exception

I have an object which has a circular reference to another object. Given the relationship between these objects this is the right design. To Illustrate Machine => Customer => Machine As is expected I run into an issue when I try to use Json to serialize a machine or customer object. What I am unsure of is how to resolve this issue as...