circular-reference

Database design: circular references

懵懂的女人 提交于 2019-12-22 09:59:54
问题 I have three database tables: users emails invitations Emails are linked to users by a user_id field. Invitations are also linked to users by a user_id field Emails can be created without an invitation, but every invitation must have an email. I would like to link the emails and invitations tables so it is possible to find the email for a particular invitation. However this creates a circular reference, both an invitation and an email record hold the id for the same user. Is this bad design

Resolving Circular References for Objects Implementing ISerializable

随声附和 提交于 2019-12-22 09:57:15
问题 I'm writing my own IFormatter implementation and I cannot think of a way to resolve circular references between two types that both implement ISerializable. Here's the usual pattern: [Serializable] class Foo : ISerializable { private Bar m_bar; public Foo(Bar bar) { m_bar = bar; m_bar.Foo = this; } public Bar Bar { get { return m_bar; } } protected Foo(SerializationInfo info, StreamingContext context) { m_bar = (Bar)info.GetValue("1", typeof(Bar)); } public void GetObjectData

Defining circular references using zope.schema

三世轮回 提交于 2019-12-22 09:50:04
问题 I'm trying to do the following, define two classes whose instances mutually reference one another, like Users and Groups in the following exemple. A User can belong to several groups and a Group can contains several users. The actual data is stored in a database and there it is a simple matter of many-to-many relationship using foreign keys. No problem at all. Afterward the data is loaded through an ORM and stored in instances of python objects. Still no problem at all as the ORM used

How to properly design this part of a database (circular reference?)

两盒软妹~` 提交于 2019-12-22 00:06:48
问题 Situation: A company has many projects A project has many tags A project belongs to only 1 company A tag can belong to multiple projects A company must have access to its own tags Example 1: In the first image, all tags for the company are available through the projects/project_tag. But if all projects are removed, then the tags for the company will not be accessible anymore, because the link between project_tag and projects is gone. The tags should be somehow always be linked to the company,

Is there a solution about Gson “circular reference”?

爱⌒轻易说出口 提交于 2019-12-19 06:29:20
问题 I have found many articles about the circular reference with Gson, but I can't find an elegant solution. As I know, some solutions is: Set the property that caused circular reference as "transient". exclude the property with some annotation. But as a general question, is there some common strategy to solve the problem? 回答1: As far as I know there is no automated solution for circular references in Gson. The only JSON-producing library I know of that handles circular references automatically

Resolving Circular References (C#)

倾然丶 夕夏残阳落幕 提交于 2019-12-18 05:06:22
问题 I'm having a couple of problems with circular reference/dependency that I've been sitting on all day. Something must be wrong with my thought process, I just don't get it. Here are my projects: Flip.Main (ASP.NET MVC) Flip.Domain (C# DLL) Flip.Services (C# DLL) Flip.Utility (C# DLL) Current References/Dependencies: Flip.Main -> Flip.Domain, Flip.Services, Flip.Utility Flip.Services -> Flip.Domain, Flip.Utility Flip.Domain -> Flip.Utility I wanted to structure my project in a way that my

Circular reference in C++ without pointers

依然范特西╮ 提交于 2019-12-18 05:04:24
问题 Is there a way to define circular references without using pointers? I need to have somthing like this: struct A; struct B { A a; }; struct A { B b; }; Thanks! 回答1: You can use references instead struct A; struct B { A& a; }; struct A { B b; }; But no it's not possible to create a circular reference without some level of indirection. What your sample is doing is not even creating a circular reference, it's attempting to create a recursive definition. The result would be a structure of

How to deal with circular references?

拟墨画扇 提交于 2019-12-18 03:03:30
问题 If I have those two projects: MyCompany.ERP.Billing MyCompany.ERP.Financial Billing asks/sends information to Financial and vice-versa. Both are too big so I don't want to put them in a single project. Visual Studio doesn't allow circular references. How would you deal with that? 回答1: Extract interfaces from your classes and put them into a core project referenced from both Billing and Financial projects. You can then use those interfaces to share data between assemblies. This only allows you

c# : Utility to find circular references / compile in correct order?

血红的双手。 提交于 2019-12-17 20:51:01
问题 doers anyone know of a good utility or program to interrogate a solution or a directory for all projects and tell you where circular references are and possible compile in order.. I remember see one a while ago but i can't find it anywhere.. 回答1: NDepend is an excellent tool that will do this and a lot more. Maybe it's overkill for what you want, but there's a trial version so have a look... 回答2: I know this is a late answer, but I found using GraemeF and tsilb's answers both showed no

Is there a way to test circular reference in JavaScript?

会有一股神秘感。 提交于 2019-12-17 18:29:10
问题 I'm making a game, and I've come across a problem... When I try to save, JSON fails and reports that circular reference is being made somewhere. I don't think it actually is, I can't see it, so is there an algorithm or anything which could tell me where it is exactly (between which objects and stuff)? Also, is there a JSON alternative that can save circular reference? I'm running a node.js server, I saw this, but I can't get it to work (it's not made as a module i can require() in my code).