Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [coupling]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
5 answers
472 views

What is the right understanding for cohesion and coupling?

I'm trying to better understand cohesion and coupling. More specifically, I'm trying to use examples to better cement the concepts and one of the most common examples I see goes something like this. ...
SuperJumbo's user avatar
0 votes
3 answers
331 views

Does turn "global state" into "passing parameter" increase the whole system coupling or not?

As far as I know, coupling is about counting number of other classes in a class, so for the following program that emulates a UI program that shows "WelcomePage" at start and also pops a ...
wcminipgasker2023's user avatar
0 votes
1 answer
87 views

using same table for multiple features a bad coupling?

We are migrating a template that was a mere questions array questions [ { type:text, name:first, value:What is our name },{ type:radio, name:favourite fruits, value:[ ...
veritas's user avatar
  • 131
3 votes
4 answers
484 views

Does "declare the most abstract type" increase coupling actually?

According to Why define a Java object using interface (e.g. Map) rather than implementation (HashMap), I know I should declare the most abstract type possible, so for example: public interface Fruit{ }...
wcminipgasker2023's user avatar
0 votes
0 answers
197 views

Client-Server Coupling in gRPC vs REST

Quoting this article - The Other key differences: gRPC vs. REST section (client server coupling): Client-server coupling REST is loosely coupled, which means the client and the server do not need to ...
Veverke's user avatar
  • 451
0 votes
0 answers
41 views

Binding delegates from owner vs in component to prevent coupling

While researching the topic of Coupling, I still have a little misunderstanding about what counts as less / more Coupling. I will take as an example two options for setting delegates in Unreal Engine ...
scydev's user avatar
  • 1
-1 votes
5 answers
146 views

How not to share information across service boundaries in SOA?

We are often told to avoid sharing business data across service boundaries. However, I tend to see the need for a service to access data from a different service. An example of this would be IT ...
geeko's user avatar
  • 246
1 vote
2 answers
548 views

Software Design: Decoupling when highly dependent on a third party library

As part of an university project I am currently working on an eeg-biosignal classifier. While the project itself doesn't really focus on design ("anything that works") I am trying to learn ...
J. Lo's user avatar
  • 21
0 votes
1 answer
126 views

Return type abstraction of a service layer that calls an API

I'm trying to find the best solution to abstract the return type of the service layer. I have a controller that calls a service to create a user. The service calls a REST API and receives an HTTP ...
Achref RIAHI's user avatar
1 vote
1 answer
619 views

How can we remove business logic from the frontend for complex, highly interactive UI's? Should business logic always live exclusively on the backend?

I have a UI for a tool with a fair amount of user interaction. Imagine a sports tournament predictor where you select which team will finish 1st in the group, 2nd in the group etc., with the winners ...
MSOACC's user avatar
  • 945
0 votes
2 answers
388 views

Making a Data Layer that is tightly coupled to the Presentation Layer in Clean Architecture

So I've got a simple object recognition app in iOS. I am trying to create an Interface-Adapter for the machine learning / computer vision like this: protocol MachineLearningInterface { func ...
Bawenang Rukmoko Pardian Putra's user avatar
16 votes
7 answers
5k views

Where should interfaces be used?

One thing I've long struggled with being able to grasp properly is, when designing a program in an object-oriented language, where and how should explicitly named/defined interfaces be added? In ...
The_Sympathizer's user avatar
1 vote
3 answers
1k views

In a microservice architecture without sharing a DB, how to spin up a worker to make changes in other microservices database?

Currently we have a MicroserviceA which has a database of objects that need to be hydrated with some KI calculated data. For this it queries MicroserviceB via REST in batches and inserts this into its ...
rStorms's user avatar
  • 113
0 votes
1 answer
216 views

How can I split tightly coupled code in an OOP language?

So I've a class that is some kind of wrapper of a state machine for a multipart upload and it's database writes/reads. Everytime something is uploaded via REST basically the following happens ...
user avatar
1 vote
2 answers
131 views

How to maintain cohesion, loose coupling, and SRP when building a reporting tool?

I'm building a reporting tool with three core layers: Extract data from a database Transform this data to compute business metrics Display these metrics in a report (a heavily formatted Excel export ...
Myccha's user avatar
  • 119
0 votes
1 answer
318 views

Stable abstraction principle

I'm studying design principles, and I have a doubt in package coupling principles. I know that the 'Stable Abstraction Principle' says that a package should be as abstract as stable, and it says that ...
Gius's user avatar
  • 19
2 votes
0 answers
154 views

Cohesion and coupling possible combination in software

I know what we mean by cohesion and coupling in software. And generally the best practice is to achieve high cohesion with low coupling. It seems to me though that they are inter-related. I.e. you ...
Jim's user avatar
  • 327
2 votes
1 answer
262 views

Avoiding coupling through code sharing

I have been working on an application which consists of several cohesive services, Customer, Invoice, PurchaseOrder, Highlight, the application is deployed within a mono repo and each service is ...
berimbolo's user avatar
  • 123
0 votes
2 answers
350 views

About coupling and cohesion

At the end of this discussion about coupling and cohesion https://www.youtube.com/watch?v=hd0v72pD1MI some renowned programmers agreed in the general thought that to achieve high cohesion you have to ...
Leonardo Mangano's user avatar
3 votes
4 answers
691 views

Do I have LocalDTOs? If yes, what is a good approach to keep encapsulation of the domain model?

LocalDTO term refers to Fowler's article. Say I have a domain entity Person: public class Person { private String id; private String name; private int age; } This entity has its own ...
George Z.'s user avatar
  • 705
1 vote
2 answers
235 views

Anemic Domain Model VS coupling and dependencies- design conflict - need an Object oriented advice

on design stage , after finding my main objects , I am always find my self writing "manager" or "controllers" classes in order to handle the connection between them. some of the ...
user3717741's user avatar
0 votes
1 answer
261 views

In CQS is it accepted to have a coupling to another command

Consider this code, rather than hardcoding the hour when we execute a certain command I query the CQS engine and asks when it will be executed. Though now we have a high coupling to another command. ...
Anders's user avatar
  • 661
0 votes
4 answers
508 views

How do I decouple this coupled application?

I currently have this Bot Viewer application Which consist of the application itself - the Bot overviewer, which depends on a library Bot.Core. Within Bot.core we have defined the core interface for ...
I am not Fat's user avatar
-2 votes
1 answer
171 views

Achieving loose coupling

My scenario involves the following classes: I have three types of Peer that creates a RegistryType instance because its methods are needed. Same for Identity class. Each PeerType need 0 or all the ...
Antonio Santoro's user avatar
1 vote
0 answers
103 views

Coupling at the DB vs an API

I have a Website which has a BFF (back end for front end). It consumes data from a service (a CMS) and its own configuration data. The CMS data and the apps config data are in separate schemas (so ...
iasksillyquestions's user avatar
28 votes
5 answers
6k views

I'm not seeing 'tightly coupled code' as one of the drawbacks of a monolithic application architecture

One of the most common things I see when discussing pros/cons of microservice vs monolithic architecture is that monolithic applications have, or always trend toward, 'tight coupling.' To be honest, I'...
Bob Dole's user avatar
  • 421
1 vote
1 answer
195 views

How does one-way data binding and MVC achieve loose coupling?

In my limited understanding, one-way data binding could happen like the following: On the back-end, I have a Node backend server. In that, I have a layer that communicates with the database (Model). I ...
szeb's user avatar
  • 121
0 votes
0 answers
69 views

Application Security VS Tight coupling - High assurance of user intent

Disclaimer: I'm not sure if this is the right site as this question sits under both software engineering and security domains. Background: Assume you have a financial web application that receives ...
user161736's user avatar
1 vote
1 answer
102 views

Java, dealing with XML and JPA Annotated Classes

I use xjc to compile XSD files to Java Classes, and want to edit/extend them to make them persistable through JPA. I cant figure out what the best "Coupling?" would be and how to organize it,...
Oblivial's user avatar
2 votes
2 answers
1k views

Unit Testing Controllers without Mocks

I've done a lot of test writing using Mocks, and so I've learned that it makes refactoring difficult due to implementation coupling inherent with Mocks. I've done a lot of reading on the topic tonight,...
rewolf's user avatar
  • 139
0 votes
0 answers
70 views

Avoid tight coupling when configuring a service from a backend

I have multiple apps (app 1, ..., app n), that don't know each other but use the same services. At the same time, there is a single application to configure the services (let's call it backend). One ...
Jankapunkt's user avatar
2 votes
2 answers
571 views

C++: Achieving a decoupled "Definition is Registration" paradigm for derived classes?

I'm trying to engineer this: 200 subclasses [ Derived Classes ] After a subclass is defined, I wont need to edit any other file. [ Decoupled ] Subclass Definition registers itself. [ Definition is ...
Anon's user avatar
  • 3,613
0 votes
1 answer
61 views

Is coupling functionality desired when the usage of a function can be predicted with near-perfect confidence?

I have a function whose job is to look through a string that is a post's content and find certain pieces: public static function findInsidePostContent( $post = Null ) { //post_content comes from ...
Daniel Simmons's user avatar
2 votes
1 answer
123 views

Wrapping a legacy project in a test framework

I am working on wrapping an old project written in C# in a test framework. The largest problem I have is that I have a bunch of classes that are all VERY tightly coupled with other classes. All of ...
dartimien's user avatar
29 votes
9 answers
8k views

In software design, should an application remain agnostic regarding its usage with real world data / mock data?

Let me try to summarize a bit more with a simple example: You're building a large application, a user portal for example, with feeds, news, account management, and a whole range of difference ...
SikoSoft's user avatar
  • 415
28 votes
8 answers
7k views

Coupling: Theory vs Reality

Coupling is defined as the knowledge one object has about another one, which describes how dependent they are. The more dependent, the worse, since changes in one would impact in the second. High ...
Asier Naiz's user avatar
-1 votes
2 answers
815 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 ...
ProgramCpp's user avatar
8 votes
3 answers
4k 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 ...
Blackclaws's user avatar
3 votes
3 answers
502 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 ...
aacceeggiikk's user avatar
2 votes
1 answer
535 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 ...
Tim's user avatar
  • 5,465
3 votes
1 answer
177 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()....
Slava Logos's user avatar
8 votes
5 answers
819 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 ...
user1861857's user avatar
2 votes
3 answers
517 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() { ...
Navjot Singh's user avatar
0 votes
2 answers
89 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 ...
Saran's user avatar
  • 397
1 vote
2 answers
5k 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 ...
Vektor88's user avatar
  • 345
0 votes
1 answer
2k 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 ...
Fabio Nardelli's user avatar
2 votes
3 answers
1k 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 ...
Jeto's user avatar
  • 169
1 vote
3 answers
213 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 ...
rendon's user avatar
  • 171
11 votes
5 answers
3k 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 ...
Dusan's user avatar
  • 585
1 vote
2 answers
3k 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 ...
Tim Clancy's user avatar