circular-dependency

Circular References in my C# projects

穿精又带淫゛_ 提交于 2019-12-21 03:47:18
问题 I have the following situation: A project MyCompany.MyProject.Domain which contains my domain model, and partial classes (such as Contact ). I want to 'extend' (by partial class, not extension method) my Contact class with a property Slug which will give me a simple URL friendly text representation of first and last name. I have a string extension method ToSlug() in my Utility project MyCompany.MyProject.Utilities which does exactly what I want in 2). The problem: My Utility project is

Avoid Circular Dependency

て烟熏妆下的殇ゞ 提交于 2019-12-21 02:28:17
问题 I am developing a travel management application. The design in question is something like following : Each person in a tour is designated as a Traveler. Each Traveler has a Passport. Now, a Traveler can be a MainMember or a SubMember, depending on whether or not he is the head of the family. A MainMember decides stuff like TourPackage, total amount for his travelling family, etc. A SubMember is dependent on the MainMember while travelling. So, if a MainMember is deleted, all its SubMembers

Recommended way to have 2+ modules recursively refer to each other in Lua 5.2

你说的曾经没有我的故事 提交于 2019-12-21 01:21:40
问题 Is there a way to have Two Lua modules (let's call them A and B ) Each module uses functions from the other, so they must require each other A third module (let's call it C ) can use A but not B e.g. C.lua : local A = require 'A' -- ... A.foo() There may be another module D that requires B but not A and/or E requiring both A and B Neither A nor B nor their members should be added to the global namespace. Avoid using the module and setfenv functions (deprecated in Lua 5.2) Related : Lua - how

Circular Dependencies in modules using requireJs

你说的曾经没有我的故事 提交于 2019-12-19 01:14:53
问题 Reading the requireJs documentation, in order to fix the Circular Dependencies, is suggested to use exports to create an empty object for the module that is available immediately for reference by other modules. I try this code but it seems to do not work. What is wrong? P.S.: read the comments for seeing the output, especially the B module inside setTimeout call. // A module define([ 'b' ], function (b) { console.log('B:', b); // B, Object var A = { boo: 1 }; return A; }); // B module define(

Circular Dependencies in modules using requireJs

帅比萌擦擦* 提交于 2019-12-19 01:12:47
问题 Reading the requireJs documentation, in order to fix the Circular Dependencies, is suggested to use exports to create an empty object for the module that is available immediately for reference by other modules. I try this code but it seems to do not work. What is wrong? P.S.: read the comments for seeing the output, especially the B module inside setTimeout call. // A module define([ 'b' ], function (b) { console.log('B:', b); // B, Object var A = { boo: 1 }; return A; }); // B module define(

Dealing with a Circular Dependency

谁说胖子不能爱 提交于 2019-12-18 15:49:20
问题 I wonder if someone can advise on any good ways to break a circular dependency between 2 classes in Java.FindBugs proposes the use of interfaces so i wonder if someone has any good experience with this type of problem. 回答1: Circular dependencies aren't always to be avoided. I'd avoid them in the large, but keeps in small tight corners of a system. In the large, i.e if data access layer and the representation layer of J2EE app circular dependent, I'd say that is a bad thing, because it means

Detecting circular imports

假如想象 提交于 2019-12-18 14:14:30
问题 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 AttributeError: 'module' object has no attribute 'attribute' where I clearly defined 'attribute' . But other times, the code doesn't throw exceptions because of

Is it possible to enable circular dependencies in Visual Studio at the assembly level? Would mutually dependent assemblies even be possible?

允我心安 提交于 2019-12-18 12:17:13
问题 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 compile two projects that are interdependent in this way? It seems to me that it must be possible, since (in my mind -- maybe I'm completely off-base about this)

C++: Conceptual circular include problem

柔情痞子 提交于 2019-12-18 09:27:36
问题 I'm making a component based entity system for a game engine. I have an entity class, which has to include the component base class header in order to define the array of components private Component* components[ 123 ] However, in the component base class I have to define a private Entity* ownerEntity , beacuse it is crucial that a component knows who it belongs to! This results in Entity.h needing Component.h and vice-versa -> Circular reference How can I solve this? 回答1: As long as you only

Resolving circular dependencies by linking the same library twice?

匆匆过客 提交于 2019-12-18 05:27:13
问题 We have a code base broken up into static libraries. Unfortunately, the libraries have circular dependencies; e.g., libfoo.a depends on libbar.a and vice-versa. I know the "correct" way to handle this is to use the linker's --start-group and --end-group options, like so: g++ -o myApp -Wl,--start-group -lfoo -lbar -Wl,--end-group But in our existing Makefiles, the problem is typically handled like this: g++ -o myApp -lfoo -lbar -lfoo (Imagine this extended to ~20 libraries with complex