circular-dependency

Clean way to deal with circular references in EF?

一笑奈何 提交于 2019-11-29 03:14:03
Say I have this table structure: Client ----------- ClientId int not null (identity) CurrentDemographicId int null (FK to ClientDemographic) OtherClientFields varchar(100) null ClientDemographic ------------------ ClientDemographicId int not null (identity) ClientId int not null (FK to Client) OtherClientDemographicFields varchar(100) null The idea is that Client (in EF) will have a ClientDemographics list and a CurrentDemographic property. The problem is when I setup the object structure and try to save it, I get this error: Unable to determine a valid ordering for dependent operations.

resolving circular dependencies with dependency injection [closed]

孤街浪徒 提交于 2019-11-29 02:52:31
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . 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

Circular dependency issue with Typescript, CommonJS & Browserify

吃可爱长大的小学妹 提交于 2019-11-29 02:28:08
I'm in the process of moving a fairly large typescript project from internal modules to external modules. I do this because I want to create one core bundle, which, if and when required, can load other bundles. A seccond requirement which I'm keeping in mind is that I'd like to be able to run the bundles (with some modifications if required) on the server with nodeJS aswell. I first tried using AMD & require.js to build the core bundle, but I came across an issue with circular dependencies. After having reading that this is common with require.js and commonJS is more often adviced for large

Circular Dependency in Backbone / RequireJS Nested List

跟風遠走 提交于 2019-11-29 02:22:38
I'm setting up a nested categories structure in Backbone with RequireJS. In this structure, a categories collection contains category models, and a single category model can contain a categories collection. Unfortunately this seems to cause the dreaded circular dependencies problem in RequireJS. I have read the docs on RequireJS ( http://requirejs.org/docs/api.html#circular ) however I am finding the explanation with 'a' and 'b' confusing. Here is my code, which is causing the problem: define([ "jquery", "underscore", "backbone", "collections/categories" ], function( $, _, Backbone,

Cannot add reference to project because of a circular dependency error

假如想象 提交于 2019-11-29 00:58:38
I created 2 dummy projects in my application and named them BAL and DAL . When I build them, they build successfully. If I add a reference to BAL to the DAL project, it added nicely. But while adding the DAL reference to the BAL project, I get the following error: A reference to DAL could not be added. Adding this project as a reference would cause a circular dependency. Can anyone help me to solve this error? Prime By Design Here's what you need to do: Right click on the DAL Project in the solution explorer and select Project dependencies in the context menu. You will now see a window that

circular dependencies between dlls with visual studio

我只是一个虾纸丫 提交于 2019-11-28 21:38:48
I have a circular dependency between two functions. I would like each of these functions to reside in its own dll. Is it possible to build this with visual studio? foo(int i) { if (i > 0) bar(i -i); } -> should compile into foo.dll bar(int i) { if (i > 0) foo(i - i); } -> should compile into bar.dll I have created two projects in visual studio, one for foo and one for bar. By playing with the 'References' and compiling a few times, I managed to get the dll's that I want. I would like to know however whether visual studio offers a way to do this in a clean way. If foo changes, bar does not need

Any good advice about how to avoid import cycle in Go?

本秂侑毒 提交于 2019-11-28 15:37:39
问题 I'm working on a Go project for a month. The good thing is Go is really highly efficient. But after a month of development I've already got thousands lines of code and many packages . To avoid import cycle is a major issue for me that anytime I got a import cycle error, I have no idea where the problem may be at first time. The Go compiler also only have very simple notice that always not good enough to locate issue quickly like: main.go:7:3: import cycle not allowed . It will only help you

Game Objects Talking To Each Other [closed]

折月煮酒 提交于 2019-11-28 15:08:26
What is a good way of dealing with objects and having them talk to each other? Up until now all my games hobby/student have been small so this problem was generally solved in a rather ugly way, which lead to tight integration and circular dependencies. Which was fine for the size of projects I was doing. However my projects have been getting bigger in size and complexity and now I want to start re-using code, and making my head a simpler place. The main problem I have is generally along the lines of Player needs to know about the Map and so does the Enemy , this has usually descended into

Spot problems with circular dependency

痴心易碎 提交于 2019-11-28 14:43:56
I am designing a system where two modules, one which gestions files and another users. For certain logic operations, they need the services offered by each other. Each module is represented by a singleton which implements a interface offering some services to each other, with abstract factories to provide them, like so: public class UserMain implements UserInternalService { /* * Internal interfaces */ /** * Allows interaction with the projects database. */ FilesInternaService fileSystem; /** * Constructor is private, as this is a singleton. */ protected UserMain() { } private static UserMain

Circular Dependencies / Incomplete Types

怎甘沉沦 提交于 2019-11-28 13:51:39
In C++, I have a problem with circular dependencies / incomplete types. The situation is as follows: Stuffcollection.h #include "Spritesheet.h"; class Stuffcollection { public: void myfunc (Spritesheet *spritesheet); void myfuncTwo (); }; Stuffcollection.cpp void Stuffcollection::myfunc(Spritesheet *spritesheet) { unsigned int myvar = 5 * spritesheet->spritevar; } void myfunc2() { // } Spritesheet.h #include "Stuffcollection.h" class Spritesheet { public: void init(); }; Spritesheet.cpp void Spritesheet::init() { Stuffcollection stuffme; myvar = stuffme.myfuncTwo(); } If I keep the includes as