circular-dependency

C++ Includes and Circular dependencies

UPDATE: Let me clarify my files and reiterate my question: main.h #include "other.h" class MyClass { public: void MyMethod(); void AnotherMethod(); OtherClass test; } main.cpp #include "main.h" void MyClass::MyMethod() { OtherClass otherTemp; // <--- instantitate OtherClass object otherTemp.OtherMethod...

How detect circular dependency in eclipse?

I'm working on a defect prediction project .my data set is eclipse 2.0. I caculated dependency graph with CDA (Class Dependency Analyzer) I use this link that help me . With CDA , I can see complete circular dependency , but CDA has no output about it. Is there a program that I can catch circular dependecy of eclipse (a large program) or...

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 the following code for a primality test: ldp :: Integer -> Integer ldp n = ldpf primes1 n...

Are circular references ever necessary?

I've inherited a Visual Studio Solution that contains numerous circular references between Projects. Is there ever a situation where this is remotely acceptable? Just trying to confirm my suspicion that this application is designed horribly. Thanks in advance. ...

circular dependency(?) in C++

Hi all, My initial suspicion was that there was a circular dependency in my code and went through http://stackoverflow.com/questions/625799/resolve-circular-dependencies-in-c. But this hasn't resolved my compilation errors. Here is the code with 3 classes - A, G & N. //A.h #ifndef A_H_ #define A_H_ class com::xxxx::test::G; namespac...

Design question - resolving circular dependency between objects

I got myself into a circular dependency between two classes, and I'm trying to come up with a clean solution. Here's the basic structure: class ContainerManager { Dictionary<ContainerID, Container> m_containers; void CreateContainer() { ... } void DoStuff(ContainerID containerID) { m_containers[containerID].DoStuff(); } } ...

Circular dependency in java classes

I have the following classes. public class B { public A a; public B() { a= new A(); System.out.println("Creating B"); } } and public class A { public B b; public A() { b = new B(); System.out.println("Creating A"); } public static void main(String[] args) ...

Makefile circular dependency

New to the idea of makefiles. Here is my Makefile: .PHONY: all homework1 CFLAGS= -g -O0 -Wall -Werror -Wno-unused-function LDFLAGS= -lm all : homework1 homework1 : program.tab.o program.lex.o %.o : %.c gcc -o$@ -c $(CFLAGS) $< %.lex.c : %.lex %.tab.h flex -o$@ $< %.tab.c %.tab.h : %.y bison --verbose -o$@ -d $< Whenever ...

MEF error, was circular dependency and is now something else...

I've got a circular dependency that recently came about because of a change in my application architecture. The application relies on a plugin manager that loads plugins via MEF. Everything up until worked fine, because it looked something like this: // model.cs [Export("Model")] public class Model { public PluginManager PM { get; s...

Python circular dependency import

Say I have three files like this: testimports module: #import moduleTwo import moduleOne hiString = "Hi!" moduleOne.sayHi() moduleOne: import moduleTwo class sayHi(): moduleTwo.printHi() moduleTwo: import testimports def printHi(): print(testimports.hiString) If I run testimports, I get the following: Traceback (mo...

dependencies between view, presenter and interface

Hi, I'm in front of a classic circular dependencies problem but the solution I've found (create a third assembly) does not seem to be ok with my view-presenter pattern. I need to reference my presenter in my view assembly I need to reference my interface(which are in the same assembly than the presenter) in my view assembly ok so I re...

How to resolve dependent classes?

I have two classes which depend on each other. I've solved this problem before but I can not for the life of me remember how to fix this. My simplified code is this: struct MenuOption{ string Text; int Choice; bool UseSubMenu; Menu SubMenu; }; class Menu{ public: Menu(MenuOption optionlist[],int optioncount); }; ...

Circular References in Database Design - Should they be avoided?

Hello guys, I am currently developing a database via MS Access 2003 and got stuck at a circular reference problem. Basically, it comes down to the following relationship triangle (it is a simplified form of my relationship table): Positions oo oo / \ ...

"Please wait until after injection has completed to use this object" error from Guice

We have two singleton objects (declared via in(Scopes.SINGLETON)) in Guice that each uses the other in its constructor. Guice's way to implement this is with proxies - it initializes the object at first with a proxy to the other object, and only when that object is needed it is resolved. When running this code from several threads, we g...

"too much recursion" error when calling JSON.stringify on a large object with circular dependencies

I have an object that contains circular references, and I would like to look at the JSON representation of it. For example, if I build this object: var myObject = {member:{}}; myObject.member.child = {}; myObject.member.child.parent = myObject.member; and try to call JSON.stringify(myObject); I get the error "too much recursion", n...

Circular class reference problem

I am developing a C# application and have an Employee class and an Organisation class. An Employee object has an Organisation as an internal member and an Organisation object has an Employee member to indicate the Org leader. Will there be any problems with this setup that can lead to an infinite circular instantiations? Edit: I just...

Dependency resolution as a seperate project ..How to?

hi, I am creating a new application using asp.net mvc, I m using munq IOC container as my dependency injection..The issue is i want to create a new project for dependency resolution where i can register all the controllers of mvc project and the repositories of infrastructure project..I have to add Dependency Resolution project as a refe...

Delphi: How to move a class out of a unit;avoid circular references

Question: i want to split two classes out to their own file, while avoiding circular references. i have a unit with some classes (and some enumerations and constants). Anyone will recognize Click and Clack the tappet brothers: unit Cartalk; interface type TSolution = (solTransmission, solBrakes, solGremlins); TTappetBrothe...

c++ how to do to deal with circular dependencies?

Hi! usually, if my #include chain gets circular, I solve it by replacing one of the #includes by a forward declaration and then move all the function implementations that depend on this type into the cpp file, where I #include the header instead. But - in some situations it's bad to put function implementation into the cpp file - espec...

OO design and circular dependencies

I am currently struggling with a circular dependency problem when designing my classes. Ever since I read about the Anemic Domain Model (something I was doing all the time), I have really been trying to get away from creating domain objects that were just "buckets of getters and setters" and return to my OO roots. However, the problem...