Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [coupling]

The tag has no usage guidance.

2
votes
3answers
152 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
155 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 ...
3
votes
2answers
247 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 ...
0
votes
0answers
79 views

Fluent validation - integrate in my business objects best practices

I am involved in the development of a price engine system. I have a set of business objects like Car, Engine, Wheels, etc I want to validate them using the framework Fluent Validation Here an example:...
13
votes
5answers
532 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....
2
votes
0answers
48 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
348 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
252 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
138 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
75 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
79 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
156 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 ...
0
votes
0answers
84 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
475 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
109 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 ...
3
votes
1answer
165 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 ...
1
vote
2answers
316 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
530 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
58 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
294 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
439 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
188 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 = [] ...
0
votes
0answers
148 views

Event correlation engine design: Nesting events vs. using event ids

I am currently (re)designing an event correlation engine and found myself to be uncertain about the design for the events themselves. I have come up with two possible solutions, but both of them seem ...
2
votes
1answer
1k 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
1k 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
111 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
128 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
120 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
113 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 ...
6
votes
3answers
137 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 ...
2
votes
1answer
301 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
173 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
1k 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
172 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., "...
9
votes
2answers
523 views

Am I trying to decouple classes too much here?

I am working on a real-time terrain rendering engine. I have a QuadTree and Node classes. The QuadTree class expands/collapses a tree depending on where the camera is. So it makes sense that the ...
5
votes
2answers
159 views

Is avoiding having the fields representing the same object in different communicating classes reasonable?

I'm developing a program which does communication to different types of devices (with respective protocols). It should concurrently acquire messages from devices and write them to a file with specific ...
166
votes
9answers
27k views

I changed one method signature and now have over 25,000 errors. What now?

I started a new job recently where I am working on a very large application (15M loc). In my previous job we had a similarly large application but (for better or for worse) we used OSGi, which meant ...
3
votes
1answer
339 views

Architecture recommendation for Android

Recently I developed an Android application which is very difficult to maintain. We are stuck in a complicated situation. We developed Android Apps which contained 500k LOC and another team developed ...
1
vote
2answers
58 views

Proper event driven design when a consumer subscribes to many producers

I have a large number of instances of a class. Those instances can fire an event. The only important thing for that event is which instance fired it. I have another instance of a class (and maybe in ...
-4
votes
2answers
228 views

Can we fix Singletons testability tight coupling?

It is well known that Singletons are anti-patters for several reasons: tight coupling singletons are pathological liars no testability inheritance is not available you cannot program to interfaces, ...
15
votes
3answers
4k views

How to decouple UI from logic on Pyqt/Qt apps properly?

I've read quite a lot about this subject in the past and watched some interesting talks like this one from Uncle Bob's. Still, I always find pretty difficult to architect properly my desktop ...
21
votes
5answers
2k views

Why would a type be coupled with its builder?

I've recently deleted a java answer of mine on Code Review, that started like this: private Person(PersonBuilder builder) { Stop. Red flag. A PersonBuilder would build a Person; it knows about ...
18
votes
4answers
2k views

Event-driven programming: when is it worth it?

Ok, I know the title of this question is almost identical to When should I use event based programming? but the answers of said question have not helped me in deciding whether I should use events in ...
4
votes
1answer
561 views

Dependency Injection & In-class Instantiation | Practical Limitations

Dependency Inversion is Good Inversion of dependency is good, it: Simplifies unit-testing Reduces coupling, allowing software components to be used interchangeably Keeps instantiation logic for a ...
1
vote
1answer
546 views

How to uncouple and reuse persistence logic, user interface logic and business logic amongs embedded software projects

I have been working in embedded devices business more than 5 years as a software engineer. Most of the times our hardware manufacturers provide a Software Development Kit for their reference boards. ...
1
vote
1answer
75 views

Package Interfaces - Coupling & Re-Usability

Intent Packages should be designed to perform a single function well. Ideally this means that they should be highly modular and different packages should be able to be 'plugged-in' simply by ...
4
votes
3answers
2k views

Communicating to an Object from another without coupling in java?

So I have a Person object, and a GumballMachine object. The behavior I'm searching for is, in the intent to avoid unnecessary coupling, have the method insertCoin() called from within the Person ...
4
votes
1answer
184 views

Where to initialize objects

I have an BallEntity class that is part of a game that uses a Entity Component System architecture. This class have 'components' that are like the attributes of that class. I create and initialize ...
4
votes
1answer
134 views

Low coupling when using sealed classes?

Typically, when trying to decouple classes I use Inversion of Control. Lately I've been using a third-party library whose components are sealed. Are there any design patterns to handle this situation? ...
0
votes
1answer
88 views

Are there any strong reasons to use DI for sub-classes that are known to be tightly coupled to their parent containers?

I have Product classes for Products A through Z. And each Product class has its own set of product-specific subclasses, which I'd say are tightly coupled to them, like so: //specific product class ...