Skip to main content

Questions tagged [circular-dependency]

Filter by
Sorted by
Tagged with
0 votes
1 answer
221 views

I'm building a JavaFX + Spring Boot application using the MVVM pattern. I’m building a generic “wizard” in a JavaFX + Spring Boot MVVM app. A WizardViewModel drives a sequence of steps (STEP_ONE → ...
Billie's user avatar
  • 77
0 votes
4 answers
500 views

Class and component dependency cycles Assume, we have component A with class CA, and component B with class CB, with a cyclic two-way dependency between classes CAand CB. Hence, we have a cyclic ...
dn1h's user avatar
  • 19
2 votes
4 answers
505 views

For example, I have a Business Intelligence (BI) microservice, it reads data from other microservices, and displays the data as a bar chart or some other styles. My problem is, the BI microservice ...
NingLee's user avatar
  • 230
6 votes
2 answers
5k views

In a legacy project's service layer, there are tens of service classes and among them there is one service, UtilityService using 2 other services: class UtilityService{ private UserService ...
Rui's user avatar
  • 1,935
0 votes
3 answers
2k views

For a game I'm making I have two objects; Gun and ReloadSystem. At the moment, these two object reference each other. Gun tells ReloadSystem to perform a reload when the gun gets clicked, and ...
Boudebouz1's user avatar
0 votes
2 answers
308 views

I have a command line application written in C#. Here's some facts about the program that are relevant to my question: The application has a "data directory" (e.g. ~/.config/myapp) where ...
void.pointer's user avatar
  • 5,153
3 votes
1 answer
215 views

If I am working on a project, say it has this file structure: car/ body/ __init__.py doors.py bonnet.py engine/ cyclinderhead/ __init__.py pistons.py ...
run_the_race's user avatar
0 votes
0 answers
54 views

DataModel contains a Proof that contains all the information of its integrity along with the method with which the Proof should be verified. In this case I designed a JWS type of proof that can be ...
Antonio Santoro's user avatar
-1 votes
2 answers
175 views

I have two tightly coupled classes Basket and Discount. Basket is responsible for keeping track of the items in a shopping basket, keeping track of any discount codes applied, and calculating the ...
Adam Griffiths's user avatar
0 votes
3 answers
193 views

The problem I have relates to an existing system in a specific business domain. I've simplified it into a very similar 'Library/Book' relationship to articulate the problem. Answers such as 'why would ...
Nathanial's user avatar
  • 419
0 votes
0 answers
488 views

I have two classes AST and ASTNode for working with some tree-like data. Both these classes have networkx graph as a field and a node id (integer). For AST this id refers to the root of a tree. These ...
Yaroslav Kishchenko's user avatar
-1 votes
1 answer
325 views

I'm trying to learn how to implement a DAO design pattern (for a game, but this does not really matter). In my program, I have a database layer which has user objects. Then in the code, I have a DAO ...
omega's user avatar
  • 139
2 votes
2 answers
806 views

I'm looking to make a clean modular architecture. I hear all around how bad are circular dependencies, and I'm convinced that the less two modules are coupled, the most reusable the code will be. But ...
TOPKAT's user avatar
  • 131
-2 votes
1 answer
2k views

I have this basic design with a circular dependency. Is there any solution for this? The problem is that a Machine cannot be created if a Model for that Team has been submitted.
Antonio Santoro's user avatar
5 votes
3 answers
930 views

In my project I'm using the observer pattern in several places, i.e. the subject notifies the observers about something, and expect them to act. The subject does not know anything about the details of ...
C-Otto's user avatar
  • 169
-2 votes
2 answers
323 views

I have a Base class that all other classes inherit from, including the User class. However, in the Base class I need to capture the createdBy, updatedBy, and deletedBy fields which all are going to ...
geeko's user avatar
  • 256
0 votes
0 answers
198 views

I am trying to abstract some functionality from my desktop application (JavaFX) for changing views. So, what I am thinking is: Navigator interface with methods like goToAccountsOverview(), ...
alexk745's user avatar
2 votes
3 answers
964 views

I am implementing a library that: Takes some input data (I put data structures and classes in the parsing package) Stores the data in a structure (I put data structures and classes in the storage ...
Vigenere's user avatar
  • 129
0 votes
2 answers
4k views

I was writing some code and came across a scenario that I was thinking about doing a circular dependent class, which I have not done before. I then looked circular dependencies up and whether they are ...
Isa's user avatar
  • 109
3 votes
2 answers
3k views

I understand that having circular dependency can be bad design. However, I have a question regarding a certain class structure. As an example: ocean.ts import {Boat} from './boat'; export class ...
Ray's user avatar
  • 49
2 votes
3 answers
2k views

Say we consider two inherently coupled elements, using a real-life like example: Body PhysicalIllness Note: the following code is pseudo-Java for the sole purpose of syntax-coloring, pure syntax doesn'...
Jeto's user avatar
  • 169
1 vote
0 answers
90 views

I am working on a project which requires me to execute standard HTTP calls with session tokens. I am building a custom HTTP client, with a custom authenticator, something like this: Client client = ...
lazyloader's user avatar
0 votes
1 answer
144 views

Let's assume I have three classes, as follwing: class A { Array<B> bs; createB() { b = new B(); this.bs.insert(b); return b; } } class B { Array<C> cs; createC() { c = new C(); ...
Deer's user avatar
  • 23
5 votes
1 answer
2k views

I am currently starting a new project with a 4-tier architecture design. The layers is set as follow. +------------------+ +---------...
mannok's user avatar
  • 189
5 votes
3 answers
20k views

I am trying to resolve a circular dependency between two components in my system. The Messenger component is responsible for sending and receiving messages on a web socket. The Controller component ...
Robert Hunt's user avatar
4 votes
3 answers
3k views

For example, if 2 classes depend on each other, it is a kind of circular dependency and should be avoided. How about methods? for example, if I have 2 methods which call each other: public void ...
ocomfd's user avatar
  • 5,760
0 votes
3 answers
294 views

I have a MDI MyMDIWinForm that needs an instance of IGUIErrorHanlder for error handling, At the same time IGUIErrorHanlder depends on the MDI MyMDIWinForm for having a place from where to launch pop-...
X.Otano's user avatar
  • 622
3 votes
1 answer
435 views

"Single item in a set depends on the whole set. Set depends on that item." I'm creating a compiler (https://github.com/SuperJMN/Plotty). In the last stage, the Intermediate Code is converted to ...
SuperJMN's user avatar
  • 453
3 votes
4 answers
764 views

I've heard circular references are generally an issue, however I was wondering if this was true for interfaces that reference other interfaces, for example: IQuestion{ IAnswer getCorrectAnswer(); ...
Aidan Connelly's user avatar
1 vote
3 answers
3k views

I have a service that needs to make a callback. Basically, it is an event that is expected to be handled in exactly one place, and that is too important to be optional. The obvious approach seems to ...
Timo's user avatar
  • 402
-1 votes
3 answers
450 views

I am developing two libraries in .Net Firs one it's a library with core functionality (named it Library.Core.dll) Let's focus in User class public class User { //set of constructors and ...
X.Otano's user avatar
  • 622
1 vote
2 answers
6k views

I have 2 classes that have dependencies. public class AuditManager { //set of methods public static AuditManager Singleton= new AuditManager(); public int AuditEvent(int x){ ...
X.Otano's user avatar
  • 622
3 votes
2 answers
2k views

I'm attempting to build a web front-end based on the MVC pattern, as opposed to based on the libraries involved (e.g. React.js). I'm using constructor-based dependency injection and interfaces to de-...
pleasedesktop's user avatar
3 votes
3 answers
227 views

I understand if 2 classes have circular dependency, eg: public class MyWindow{ public MyWindow(){ new MyDialog(this); } public onDialogResponse(int option){ } } public class ...
ggrr's user avatar
  • 5,893
7 votes
2 answers
6k views

I am relatively new to microservice architecture and I was never before involved in a project where the architect insists on having a circular dependency between services. I am in a position without ...
gsf's user avatar
  • 274
3 votes
1 answer
110 views

As part of a program I am developing for practice purposes, I've created a namespace Core designed to contain the core code resources for the program to use. This namespace is in a Class Library ...
Michael Haddad's user avatar
-1 votes
3 answers
2k views

I have to design a database in a Rails application, where I have users (who can login), companies and jobs. Each user belongs to a company, and each job belongs to a company, so when a user logs in, ...
Karl's user avatar
  • 107
27 votes
5 answers
4k views

In the following code example, we have an class for immutable objects that represents a room. North, South, East, and West represent exits into other rooms. public sealed class Room { public Room(...
Rock Anthony Johnson's user avatar
0 votes
1 answer
96 views

I want my Wire objects to be in connection with Port objects. That is Port has a list of connected wires and method Port.add(wire). Similarly, Wire has list of ports it is connected to and Wire.add(...
Little Alien's user avatar
1 vote
2 answers
1k views

I have the following circular dependency that I'd like to eliminate. I think I must have a flaw in my design. And I'd much appreciate any feedback on how to fix this. My circular dependency comes ...
user3240688's user avatar
0 votes
1 answer
107 views

I am not sure how to phrase this. I believe this should have been asked somewhere, but I am unable to find it because I don't know the keywords. Basically, I have some types like this: interface Foo ...
SOFe's user avatar
  • 728
16 votes
5 answers
26k views

Suppose, I have class Boss and Worker; Boss has a Worker and Worker holds a reference of Boss: Boss.h #include "Worker.h" class Boss{ public: Worker worker; }; Worker.h class Boss; class Worker{...
ggrr's user avatar
  • 5,893
0 votes
2 answers
2k views

I made an extensive research in previousv related questions, but since my questions is somewhat peculiar, I decided to create this new one. I am implementing a visualisation application (in JS). ...
Dimos's user avatar
  • 419
0 votes
0 answers
160 views

Let's say I'm modelling an organizational hierarchy which consists of Divisions that contain Departments that contain Teams. So Division -> Department -> Team. While it makes sense for the Division ...
Legion's user avatar
  • 539
1 vote
4 answers
233 views

I am currently issuing a problem while forming the program-design, which is exact like a File-Directory relationship, and to ease it, I am using that as an example. I think it is usual, that a ...
user3698624's user avatar
1 vote
3 answers
218 views

So, I had to create a class that had a member of it's own type. I looked into why this was possible, which is fascinating. Reading the answer, I find that a lot of work had to go into making this work,...
Sidney's user avatar
  • 181
0 votes
4 answers
2k views

(TLDR) To build a parser for a recursive grammar by composition of individual parsers (e.g. with a parser combinator framework), there are often circular dependencies between some of the individual ...
donquixote's user avatar
52 votes
3 answers
121k views

I have three classes that are circular dependant to each other: TestExecuter execute requests of TestScenario and save a report file using ReportGenerator class. So: TestExecuter depends on ...
sabrina2020's user avatar
2 votes
2 answers
5k views

How would one go about designing classes for a system in which two components depend on each other? For a more concrete example, consider this scenario, you're designing a piece of software to manage ...
Khaled Nassar's user avatar
3 votes
1 answer
1k views

Most of the static code analysis tools which analyse class dependencies generate dependency pairs of classes where each pair represents a direct dependency between two classes. Given those dependency ...
Heramb Deware's user avatar