Questions tagged [coupling]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
4 answers
443 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
85 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
  • 423
0 votes
0 answers
36 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
126 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
  • 236
1 vote
2 answers
470 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
106 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
463 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
  • 935
0 votes
2 answers
325 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
4k 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
818 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
201 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 ...
Regyn's user avatar
  • 149
1 vote
2 answers
130 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
231 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
144 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
  • 317
1 vote
1 answer
228 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
  • 113
0 votes
2 answers
277 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
629 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
201 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
241 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
  • 671
0 votes
4 answers
472 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
145 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
95 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
176 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
63 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
93 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
57 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
496 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,593
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
120 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
774 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
7 votes
3 answers
3k 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
469 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
476 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,425
3 votes
1 answer
167 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
739 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
492 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
88 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
208 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
2k 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
0 votes
1 answer
339 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 ...
Feisty Otter's user avatar
0 votes
2 answers
426 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 ...
Ashton Spina's user avatar
1 vote
0 answers
493 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 ...
rudicangiotti's user avatar