circular-dependency

C++ class dependencies

Hi everyone! I'm having some problems with my class because they both depends on each other, to one can't be declared without the other one being declared. class block: GtkEventBox { public: block(board board,guint x,guint y): image("block.png") { this.board = board; this.x = x; this.y =...

C# Circular Dependency Problem Solving Technique

While dividing my C# application in layers, I have solved the problem of circular dependency among layers in the following way: using System; using System.Collections.Generic; using System.Text; using SolvingCircularDependency.Common; using SolvingCircularDependency.DA; namespace SolvingCircularDependency.BO { public class MyClass...

resolving circular dependencies with dependency injection

I've seen several articles on various websites that propose resolving circular dependencies between .NET assemblies by using dependency injection. This may resolve the build errors but it's not really resolving the circular dependency, is it? To me, there seems to still be a logical error in the architecture. Am I crazy or do others a...

Circular dependencies in flex libraries

I have two Flex libraries that reference each other. Both use link type "External", and I manually load then with the Loader class. I'm getting the error "A cycle was detected in the build path of project: foo". Is there any way to resolve this? Maybe a parameter for the compiler or something. I don't think there should be a problem, ...

Circular import dependency in Python

Let's say I have the following directory structure: a\ __init__.py b\ __init__.py c\ __init__.py c_file.py d\ __init__.py d_file.py In the a package's __init__.py, the c package is imported. But c_file.py imports a.b.d. The program fails, saying b doesn't...

Using different versions of a python library in the same process

We've got a python library that we're developing. During development, I'd like to use some parts of that library in testing the newer versions of it. That is, use the stable code in order to test the development code. Is there any way of doing this in python? Edit: To be more specific, we've got a library (LibA) that has many useful thi...

Possible circular reference problem

I am not an idiot, but header files make me feel like one sometimes. I have what is probably an overly-complicated set-up that has an error that I cannot resolve. Here it is in about as simple as detail as I can make it.... I have a Controller class that contains a Model class. I have a Scene class to capture actions and communicates ...

How should I arrange my projects/classes in .NET to avoid circular dependecies.

My program is attempting to draw grammars in C# & WPF. I have: 1 DataStructure project which describes a tree structure of how it should be visualised. Each node in the tree relates to a symbol in the grammar. Nodes at the top define the rule for that nonterminal symbol. 1 Drawer project which describes the user controls in WPF. I nee...

Anticipating possible circular-reference situation in upcoming .Net project idea... anything to watch out for?

So I've got this data access layer, and I also want to log to the database. In the spirit of eating my own dog food, I want to use my data access layer to do the logging. However, I also want to log the data access itself. Like so: App || V Log || V Data=>Log Am I at risk of getting into a feedback loop? If so, how should I avoid it? ...

Can dependency injection prevent a circular dependency?

Project#1 has some interfaces and classes that project#2 references. Now I want to use the implementation of Project#2 in Project#1 but vs.net complains about a circular dependency. If I was to use dependancy injection in Project#1 and bind to the implementation in Project#2 (since it adheres to the interface contract), will this work ...

ImportError: Model A references Model B, Model B references Model A

Hello guys, I think this is more a python question than Django. But basically I'm doing at Model A: from myproject.modelb.models import ModelB and at Model B: from myproject.modela.models import ModelA Result: cannot import name ModelA Am I doing something forbidden? Thanks ...

C++: Template Parameter Cyclic Dependency

Hello, This is more a best practice question than a language question in itself, since I already have a working solution to what seems to be a common stumbling block in C++. I'm dealing with a typical cyclic dependency issue in template parameter substitutions. I have the following pair of classes: template<class X> class A { /* ... *...

What is the convention for designating the primary relationship in a one-to-many relation between tables?

I understand how to design a database schema that has simple one-to-many relationships between its tables. I would like to know what the convention or best practice is for designating one particular relationship in that set as the primary one. For instance, one Person has many CreditCards. I know how to model that. How would I designate ...

Two classes and inline functions

I have two classes and both of them uses some of the other class, on example: // class1.h class Class1; #include "class2.h" class Class1 { public: static Class2 *C2; ... }; // class2.h class Class2; #include "class1.h" class Class2 { public: static Class1 *C1; ... }; And when I define it like in example above, it works ...

iPhone: Warning in Cyclic import in MKAnnotation: method not found

I just resolved a cyclic dependency problem by using class forwarding. Now, I am getting a warning of no 'showSumDetails' method found. I don't understand why it should happen at all, any help will be appreciated. Including a bit of code here: MyAnnotation.h #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> //#import "MyMapVi...

Three20 dependency problem

Hello all! I checked out the three20 source and was trying to follow this guide to build an iphone app using the framework. Within this guide, Templates are used which I checked out too. They ought to compile properly, but I get the following error: File /Users/myUser/programming/three20/src/build/Debug-iphonesimulator/libThree20.a de...

detecting circular imports

I'm working with a project that contains about 30 unique modules. It wasn't designed too well, so it's common that I create circular imports when adding some new functionality to the project. Of course, when I add the circular import, I'm unaware of it. Sometimes it's pretty obvious I've made a circular import when I get an error like A...

Building Java projects with circular imports in Eclipse

I have a legacy Java (not my native language) app that I'm trying to build in Eclipse Galileo. As it's not my own, I can't speak to the quality of the design, but I am coming across a number of instances where I'll have something like this: In a project called, say, "lib_a", I'll have a file containing this: import com.acme.lib_b.onet...

Compiling C++ when two classes refer to one another

I am trying to write a simple wrapper around a connection pointer that will return it to the pool when the wrapper is destroyed, but it wont compile because the ConnectionPool and AutoConn need each other to be declared. I tried to use forward deceleration but it didn't work. How do I solve this? (using g++) class Connection {}; class...

Avoid Circular Reference in Swing GUI

Maybe it's not worth worrying about in this scenario, but lets say you have two classes, a JFrame with all its components, and a server-like class that handles requests from remote clients. The user is able to start and stop server objects through the GUI, and is shown various events that happen to each server object. Whether or not I us...