Questions tagged [coupling]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
2answers
68 views

Can a service be split into two microservices using common libraries?

I am thinking of splitting a service serving multiple endpoints into microservices that can serve a set of endpoints but the problem is that the two services have certain logic in common. can the two ...
4
votes
3answers
263 views

Clean Architecture: Use case spanning multiple UI elements

So I'm currently trying to write a project using Clean Architecture. Its a Unity Engine project which doesn't make the task any easier. The Issue I'm running into however is much more basic and has ...
3
votes
3answers
279 views

Fruit obj=new Orange(); and Orange obj=new Orange(); if both works identically in my code, which is the less coupling one?

Suppose I have 2 classes (which don't show methods to look simpler): public interface Fruit{ } public class Orange implements Fruit{ } , and assume I can use 2 ways to initialize Orange without ...
2
votes
1answer
66 views

Do persistent/transient communication and temporal decoupling/coupling mean the same?

In Distributed Systems by Tanenbaum, p67 says CHAPTER 2. ARCHITECTURES 2.1. ARCHITECTURAL STYLES Cabri et al. [2000] provide a taxonomy of coordination models that can be applied ...
2
votes
1answer
120 views

How to properly decouple using interface

I have a ecosystem simulation where animals move and collide with each other. Here is how I handle collisions: public void HandleCollisionBetween(Animal a, Animal b) { if (a.GetType()....
5
votes
5answers
318 views

How to avoid many objects in constructors when many steps are performed by a class

I have a process which must do 8 steps, in a particular order. One of the step involves sending an email, another one going on a distant FTP server, another one querying a database, and so on. Now to ...
1
vote
3answers
182 views

Is this a good enough example of Factory method pattern?

On Wiki page for Factory method pattern, there is following example: public interface IPerson { string GetName(); } public class Villager : IPerson { public string GetName() { ...
0
votes
2answers
75 views

An 'internal' scope class available only to selected classes

In many languages there is a scope that is just less than public called internal. Wondering, Why none of the language, implemented a feature on internal such that one can specify Only what other ...
0
votes
0answers
22 views

Azure Service Bus Topics - Is Orchestration Needed?

We have a business process that does classic shopping/ordering. It's tightly coupled right now and does things like this: A person can view inventory. A person can create an order. An order needs to ...
0
votes
1answer
700 views

Parsing and validation of a csv file

I am trying to create a library where I need to validate and parse a file in a CSV-like format and then use this data to generate a Tree data structure. At the moment I split the process into two ...
0
votes
1answer
157 views

How to output exception messages in GUI applications in order to decouple application code to GUI code?

I want to make GUI applications such that the non-GUI code is independent from the GUI one (let's say I'll use Java 8 and Swing for example). The goal is that I could hypothetically change the GUI ...
2
votes
2answers
222 views

Tight coupling between parent and children: always to be avoided?

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 ...
1
vote
3answers
193 views

Is it a good idea to use data structures(classes) provided by a dependency in our system?

I am building a new system, which I will call S, that needs to get some data from another system, which I'll name D. System D provides a client and a collection of classes(POJOs) to represent the ...
11
votes
5answers
2k views

How to use dependency injection and avoid temporal coupling?

Suppose I have the Service that receives dependencies via constructor but also needs to be initialized with custom data (context) before it can be used: public interface IService { void ...
1
vote
2answers
332 views

What is the appropriate architecture to access variable in parent from element of child list?

I have a Parent object which looks like this (pseudocode): class Parent { String token; Child[] children; } It contains a token string and an array of Child objects. My problem is that each of ...
0
votes
1answer
155 views

How to connect two objects that communicate with each other?

I am writing a simple chat using Node.js, Websockets and Vue.js. Specifically, I have a Vue instance and a Websockets Client. When a user presses a "Submit" button, Vue asks the Client to send a ...
0
votes
2answers
217 views

Referencing Database Primary Keys from Codebase

I don't have a lot of experience with these kind of issues, but I feel I need to consult on this issue. The current codebase I'm working on is using what I consider to be a questionable technique to ...
1
vote
0answers
305 views

Designing a multithreaded TCP/UDP server for audio sharing

As briefly introduced in the question title, I am trying to design and implement a server application able to let clients share audio contents between themselves. In order to achieve that, I decided ...
3
votes
3answers
3k views

Business Logic Entities and Data Access Layer Entities

I am thinking on how to structure a project. I wonder if it is a good practice to use different entity classes between the BL and DAL in order to decouple these layers. I have worked on projects ...
2
votes
3answers
218 views

Does SRP feed tight coupling?

I designed a function which, afterwards, I noticed it is clearly doing 2 very different tasks in the same time. So now I am thinking to split it into 2 different functions, each one of them doing ...
4
votes
2answers
652 views

Does composition increase or decrease the coupling

We know that composition is a synonym of loose coupling. From here I read coupling becomes stronger between the classes A and B when: A has an attribute that refers to (is of type) B. To ...
14
votes
5answers
584 views

Is it possible to apply DRY without increasing coupling?

Assume we have a software module A that implements a function F. Another module B implements the same function as F'. There are a number of ways to get rid of the duplicate code: Let A use F' from B....
3
votes
0answers
104 views

Packages, a controller class, and coupling vs cohesion

So I'm building my first application, in Python, and some issues have cropped up because of the lack of interfaces (I.e. explicit type declaration) My design involves several homebrew packages, and I'...
14
votes
3answers
400 views

Code coupling introduce by DRY and OOD

I'm looking for guidance about DRY vs Code coupling. I do not like to duplicate my code and I also do not like code coupling between unrelated modules. So I refactor duplicate code if I find ...
1
vote
4answers
288 views

How to prevent implementation/algorithm from leaking into unit tests?

I'm hesitating between algorithm and implementation as most of the questions here on how to prevent coupling between implementation and tests are about using spies/stubs or mocks. The typical problem ...
2
votes
2answers
354 views

Wrapping 3rd party objects that are dependant upon each other and best practices

I'm having a bit of a moment of indecision here and I'd like some perspective on it. I'm currently wrapping up objects from a 3rd party API (at home for my own project and at work), and I'm doing my ...
3
votes
0answers
105 views

Ripple Effect Analysis using coupling metrics

How can I observe ripple effect using coupling attributes alone? I first find the common coupling metrics for a set of deprecated classes in a project, like CBO(Coupling Between Objects), RFC(...
-1
votes
2answers
111 views

Should I split a single class into multiple classes to reduce dependency if possible? [closed]

For example, suppose I have a class like that: public class ABC{ private Data data; public ABC(Data data){ this.data=data; } public void ab(A a,B b){ //some codes ...
0
votes
1answer
253 views

Polymorphism factor and code maintainability

What I want to get clarified is, having a polymorphism factor of 100%, does it means code becomes hard to maintain , and does high polymorphism factor introduce high level of coupling even though ...
1
vote
0answers
141 views

Distributed systems design and coupling

I have a question around which is preferred and seen as more right approach. Out company's messaging solution of choice is Kafka. We have a task to build a service that would provide events in cloud ...
3
votes
3answers
675 views

How to decouple code behind with business logic?

I'm having a hard time to decouple two classes. I have my code behind (will call it "class A") that I use to tweak the interface (defined in xaml). Next I have a class B that is only logic. But ...
1
vote
0answers
134 views

How to decouple a message broker and its message handlers?

Project description: I have a nodejs project where I try to build a bluetooth mesh like network, each node consists roughly of 4 parts the frontend part, the message broker, a bluetooth client and a ...
2
votes
1answer
284 views

Is usage of Nested classes an example of tight coupling ? (JavaFX)

So I'm working on this game where I have a nested class which has to get access to the member functions and variables of the outer class in order to perform it's functionalities. In particular the ...
2
votes
2answers
536 views

Java loose coupling data passing between components

Let's say I have two components talking to each other. The first one calls a "get results" function from the second one. How should I return the results? For example, SomeObject getResults(String ...
1
vote
2answers
850 views

Why Named Constructors are getting popular shouldn't be an antipattern?

According to following article Named Constructors The Author suggests using static factory pattern to construct objects is way better than instantinate with new keyword. At the begining the idea is ...
0
votes
1answer
67 views

Api and Auth tightly coupled circular dependancy

I am programming an application and am having trouble finding a good architecture for some of its components. As part of the front-end app, I have a user authentication system and an API that allows ...
0
votes
2answers
654 views

Is there a reason to avoid tight coupling to a model class?

By this I mean something like Student, which is modeling a Student table row: class Student { public string lastname; public string firstname; } It doesn't make sense to me to program to an ...
0
votes
2answers
871 views

Relation between LOC and Cyclomatic Complexity

Is there something that ratio of the metrics LOC and Sum Cyclomatic Complexity in a project with many modules can talk about? Does it show the logical complexity of a module/project?
0
votes
1answer
245 views

Convenience vs Decoupling/Composition

Let's say I have a small CD burning library written in Python, with a CD class and a Burner interface + implementation classes: # Module cd.py class CD: def __init__(self): self.folders = [] ...
2
votes
1answer
3k views

What exactly is data coupling? What are its downsides?

I came across it in this article: You call a method and pass it a parameter that doesn’t affect its control flow. This is still coupling, but we’re starting to reach the kind that isn’t so ...
2
votes
1answer
2k views

OOP metrics to determine coupling

Two of the OOP metrics, Coupling Between Object classes (CBO) and Polymorphism Factor (PF) both measure coupling. Is there an instance where of them has a higher coupling while another has a lower ...
0
votes
1answer
141 views

What kind of parameter coupling is the least taxing for the caller when data needs to be mapped?

I'm creating a math library that will deal with points as function inputs (as shown below). public struct Point { public int X; public int Y; } public static class MyLib { public static float ...
2
votes
2answers
144 views

Loose coupling of daemon process and administration interface

I have a daemon process, written in Java, which I would like to be configurable at runtime via an HTTP-based API. For a number of reasons, I'd rather keep the admin API separate from the daemon ...
-1
votes
1answer
123 views

What are some ways to compare and contrast software architecture strategies?

I am currently working on an Android project that I have concluded needs refactoring done for a core part of the app experience. Let's call this part of the experience "Search". From looking at bug ...
0
votes
1answer
158 views

Method pattern and method coupling

Disclaimer: I am going to write in Python and in the context of web development with Django, but this question is not language nor framework specific. Let's say I have a PizzaManager class that ...
5
votes
3answers
147 views

Passing database connection to the library

I'm writing java library(jar file) to log Web service request and responses in a Database for in-house application. This library will have two methods registerReuqest and registerResponse. I'm ...
1
vote
1answer
491 views

Data Transfer Between Loosely Coupled Modules of an Application

Let's say we have a rather large project written in Python using the Django framework that is made up of multiple modules (proper term in Django is a project made up of multiple apps, but for the sake ...
1
vote
1answer
194 views

Qualified dependency injection and coupling

Many java DI frameworks (Spring, CDI amongst others) implements some kind of qualified injection through user-designed qualifiers annotations. interface Engine { .. } @Powerful public PowerfulEngine ...
9
votes
3answers
2k views

In a loosely coupled microservices architecture, how do you keep track of your dependencies?

A popular high level architecture choice in modern program is a REST-based microservices system. This has several advantages such as loose coupling, easy re-use, limited restriction on technologies ...
1
vote
1answer
229 views

C# - Data-Driven Design & Coupling - Mother may I?

I have used data-driven design in the past and it has worked quite well. What I dislike about it is if you need some form of a string whose value has to be updated based on other values. e.g., "...