circular-dependency

Python, Circular Dependencies, and Singletons

最后都变了- 提交于 2019-12-11 13:54:33
问题 I've dug myself into quite a hole here. I'm working on a Python/Kivy app in PyDev. The app runs off of many systems (about 10), so I shoved them into an engine to handle everything. For ease of access, I grab the engine via (the worst) singletons main.py #main.py from code import engine class MyApp(App): def build(self): engine.GetInstance().Initialize() if __name__ == '__main__': MyApp().run() engine.py #engine.py from code import system1 from code import system2 gEngineInstance = None def

how to resolve circular dependency

帅比萌擦擦* 提交于 2019-12-11 11:09:51
问题 I have added another project "xml" to my project "synchronise". So program.cs (in the xml project) runs the getDetails(), which runs the FectchDetails() in the synchronise project and returns the result as an object to the xml/getDetails(). If an error occurs in the Synchronise/FecthDetails() I want to re run the xml/getDetails(). Ive tried xml.getDetails, but it is saying it doesnt exist, because its not reference to the project so I try to add the xml project to the synchroinse but its

How to handle circular dependencies? [duplicate]

巧了我就是萌 提交于 2019-12-11 09:34:47
问题 This question already has answers here : How to handle circular dependencies with RequireJS/AMD? (7 answers) Closed 2 years ago . Given: StringPreconditions extends ObjectPreconditions ObjectPreconditions depends on StringPreconditions (one of its methods returns the subclass) Preconditions is a gatekeeper to ObjectPreconditions and StringPreconditions (making sure they both load before returning an instance) User depends on Preconditions I have this code: define(["ObjectPreconditions"],

Generics with constraints hierarchy

空扰寡人 提交于 2019-12-11 09:29:12
问题 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 dependency! // Notice how I should be // defining generics parameters // here but I can't! Value GetStateAt(Position position); void SetStateAt(Position position, State state); } As you'll down here, both IPosition , IValue and IState depend on each other. How am

cyclic dependency … how to solve?

帅比萌擦擦* 提交于 2019-12-11 06:46:43
问题 I think I have a cyclic dependency issue and have no idea how to solve it.... To be as short as possible: I am coding something like a html parser. I have a main.cpp file and two header files Parser.h and Form.h. These header files hold the whole definitions... (I'm too lazy to make the corresponding .cpp files... Form.h looks like this: //... standard includes like iostream.... #ifndef Form_h_included #define Form_h_included #include "Parser.h" class Form { public: void parse (stringstream&

Avoiding circular dependence?

落花浮王杯 提交于 2019-12-11 06:34:10
问题 Related to a previous question, I have now the following one: In the next scenery: class B; class A { // stuff, methods and so on B b; }; class B { // stuff, methods and so on A a; }; Here we have a circular dependence between A and B , but this code is ill-formed since B is an incomplete type. A solution is to change B by a pointer of B by means of a smart pointers for example. But adding pointer add complexity and resources spending unnecesarily since you don't need a pointer! In the

Node - GraphQL - Ad.user field type must be Output Type but got: undefined

自古美人都是妖i 提交于 2019-12-11 06:03:56
问题 I seem to be having circular dependency problems with using UserType inside AdType. This is my UserType file: UserType This is my AdType file: AdType If I try to use the code below I get the error "Ad.user field type must be Output Type but got: undefined" even tho I imported the UserType properly. import { UserType } from '../User/user.graphql.model' import { UserSchema } from '../User/user.mongoose.model' const user = { type: UserType, resolve(parentValue, args) { return UserSchema.findById

Lazy C++ - Chicken and Egg Problem

帅比萌擦擦* 提交于 2019-12-11 04:59:46
问题 Based on feedback I got from this question, I'm interested in using Lazy C++ on my OSX laptop. The Lazy C++ webpage has binaries for Linux and Windows available, but nothing for OSX. There's also a link to download for the Lazy C++ source, but it requires a lzz binary as part of the build process. This creates a situation where I need an lzz binary in order to get an lzz binary. How can I build lzz on my laptop without an lzz binary? Do I need to do part of the build on a Linux or Windows

iOS: circular dependency to call method in each other class

被刻印的时光 ゝ 提交于 2019-12-11 04:39:53
问题 I'm trying to implement circular dependency between my AppDelegate and my ViewController to call methods from my AppDelegate to my ViewController but it's not working. See my code as follow: AppDelegate.h: @class ViewController; @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong,nonatomic) ViewController *mainView; @end; AppDelegate.m: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { return YES; } -

Resolving circular shared-object dependencies with ctypes/cffi

我只是一个虾纸丫 提交于 2019-12-11 04:37:48
问题 I would like to use cffi (or even ctypes if I must) to access a C ABI from Python 3 on Linux. The API is implemented by a number of .so files (let's call them libA.so , libB.so and libC.so ), such that libA contains the main exported functions, and the other libs provide support for libA . Now, libA depends on libB and libB depends on libC . However, there's a problem. There's a global array defined by libA that libC expects to be present. So libC actually depends on libA - a circular