First of all: I do know that there are already many questions and answers to the topic of the circular imports.
The answer is more or less: "Design your Module/Class structure properly and you will not need circular imports". That is true. I tried very hard to make a proper design for my current project, I in my opinion I was successfu...
Our current project has ran into a circular dependency issue. Our business logic assembly is using classes and static methods from our SharedLibrary assembly. The SharedLibrary contains a whole bunch of helper functions, such as a SQL Reader class, Enumerators, Global Variables, Error Handling, Logging and Validation.
The SharedLibrary ...
Hi all,
I am creating test cases and I need to cover circular dependencies. So far I have been able to create two tables such that Table A has a FK to B and B has a FK to A.
What other circular dependencies exist / are allowed between objects? I tried to create cycles between Views but Oracle successfully rejected that.
...
I'm trying to import an Eclipse workspace consisting of about 10 projects (3 web applications and other class libraries) to NetBeans. The problem is that these projects have some circular dependencies.
When I try to import the workspace into NetBeans, it gives lots (about 50? 60?) warnings about the circular dependencies. After frenetic...
Hi,
I've got the simplest kind of circular dependency in structuremap - class A relies on class B in its constructor, and class B relies on class A in its constructor. To break the dependency, I made class B take class A as a property, rather than a constructor argument, but structuremap still complains.
I've seen circular dependencies ...
I have a WCF contract with circular references. For a simple parent-child relationship, the solution is pretty simple with .NET 3.5SP1 or greater - the IsReference property of a DataContract (this page has a good explanation).
However, my relationships are three levels deep: grandparent <-> parent <-> child. A "grandparent" has many "pa...
I have defined the following interface:
public interface IStateSpace<State, Action>
where State : IState
where Action : IAction<State, Action> // <-- this is the line that bothers me
{
void SetValueAt(State state, Action action);
Action GetValueAt(State state);
}
Basically, an IStateSpace interface should be something like a c...
I am currently facing a very disturbing problem:
interface IStateSpace<Position, Value>
where Position : IPosition // <-- Problem starts here
where Value : IValue // <-- and here as I don't
{ // know how to get away this
// circular...
I'm using .Net remoting to set up a bidirectional communication line between two objects. The basic structure is as follows:
Instances of RemoteObjectA call methods on StaticObjectA.
Instances of RemoteObjectB call methods on StaticObjectB.
StaticObjectA needs to be able to call methods provided by RemoteObjectB.
StaticObjectB needs to ...
I've made the example in Java but I think (not tested) that it works in other (all?) languages.
You have 2 files. First, M.java:
public class MType {
XType x;
MType() {x = null;}
}
Second, another file (in the same directory), XType.java:
public class XType {
MType m;
public XType(MType m) {this.m = m;}
}
Ok it's ba...
I've recently returned to C++ development after a hiatus, and have a question regarding
implementation of the State Design Pattern. I'm using the vanilla pattern, exactly as
per the GoF book.
My problem is that the state machine itself is based on some hardware used as part of
an embedded system - so the design is fixed and can't be ch...
I'm working on some Clojure code that has some circular dependencies between different namespaces and I'm trying to work out the best way of resolving them.
Basic issue is that I get a "No such var: namepace/functionname" error in one of the files
I tried to "declare" the function but then it complains with: "Can't refer to a qualified...
This probably sounds like a stupid question, but I'm going to give it a shot anyway.
So in Visual Studio, you can't have two projects X and Y such that X references Y and Y references X.
In general, I can totally understand how having a circular dependency can be problematic, for a variety of reasons.
But is it really not possible to ...
My Project
I'm writing a Winform application using VS C# 2.0 which consists in several libraries and two executables, each in its own project file and all part of the same solution.
Each project has its own Settings Class which configuration parameters. Some parameters are project specific, some are needed by more than one project (b...
Background: I am working on a framework that generates C++ code based on an existing Java class model. For this reason I cannot change the circular dependency mentioned below.
Given:
A Parent-Child class relationship
Parent contains a list of Children
Users must be able to look up the list element type at run-time
I've modeled this ...
Hi, trying to have two class that reference each others, in the same file. What would be the best way to have this working:
class Foo(object):
other = Bar
class Bar(object):
other = Foo
if __name__ == '__main__':
print 'all ok'
?
The problem seems to be that since the property is on the class, since it tries to execute...
I have the following cyclic dependency problem I am trying to solve:
typedef std::map<int, my_class> my_map;
class my_class {
...
private:
my_map::iterator iter;
};
class otherclass{
public:
my_map::iterator getIter();
private:
my_map map;
};
The compiler does not like this, since my_class was not declared before the ty...
I have two classes, Foo<T> and Bar<T>, derived from Base. Each overrides a method virtual Base* convert(ID) const, where ID is an instance of a type that uniquely identifies a particular instantiation of Foo or Bar (pretend it's an enum). The problem is that Foo::convert() needs to be able to return a Bar instance, and likewise Bar::conv...
I have a RequestHandler class and a RequestListener class. A RequestHandler creates a RequestListener and passes it a reference to itself. The RequestListener in turn calls methods on the RequestHandler to handle requests of different types when they are processed (eg handleTypeARequest(), handleTypeBRequest() and so on). Unfortunately, ...
Hi all,
it concerns following: I have two projects which should exists more or less independently from each other. Project one is a kind File System Watcher. The other one cosnists of my UI. The file watcher raises an event, if there is a new file. After that, the data from the file should be added to a database. That's coarsely the back...