Questions tagged [coupling]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
3 answers
166 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 ...
user avatar
  • 113
0 votes
1 answer
149 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
  • 141
1 vote
2 answers
117 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 ...
user avatar
  • 119
0 votes
1 answer
98 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 ...
user avatar
  • 19
2 votes
0 answers
105 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 ...
user avatar
  • 297
1 vote
1 answer
185 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 ...
user avatar
  • 113
0 votes
2 answers
159 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 ...
user avatar
3 votes
4 answers
369 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 ...
user avatar
  • 695
1 vote
2 answers
119 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 ...
user avatar
0 votes
1 answer
129 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. ...
user avatar
  • 651
0 votes
4 answers
341 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 ...
user avatar
-2 votes
1 answer
107 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 ...
user avatar
1 vote
0 answers
63 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 ...
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'...
user avatar
  • 421
1 vote
1 answer
112 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 ...
user avatar
  • 21
0 votes
0 answers
56 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 ...
user avatar
1 vote
1 answer
52 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,...
user avatar
2 votes
2 answers
533 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,...
user avatar
  • 139
0 votes
0 answers
32 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 ...
user avatar
2 votes
2 answers
293 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 ...
user avatar
  • 3,319
0 votes
1 answer
60 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 ...
user avatar
2 votes
1 answer
104 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 ...
user avatar
28 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 ...
user avatar
  • 405
25 votes
6 answers
6k 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 ...
user avatar
-1 votes
2 answers
494 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 ...
user avatar
6 votes
3 answers
2k 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 ...
user avatar
3 votes
3 answers
385 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 ...
user avatar
2 votes
1 answer
293 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 ...
user avatar
  • 5,281
3 votes
1 answer
137 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()....
user avatar
7 votes
5 answers
452 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 ...
user avatar
1 vote
3 answers
311 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() { ...
user avatar
0 votes
2 answers
81 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 ...
user avatar
  • 397
1 vote
2 answers
3k 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 ...
user avatar
  • 345
0 votes
1 answer
1k 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 ...
user avatar
1 vote
3 answers
703 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 ...
user avatar
  • 159
1 vote
3 answers
202 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 ...
user avatar
  • 171
11 votes
5 answers
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 ...
user avatar
  • 527
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 ...
user avatar
0 votes
1 answer
223 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 ...
user avatar
0 votes
2 answers
312 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 ...
user avatar
1 vote
0 answers
369 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 ...
user avatar
3 votes
3 answers
5k 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 ...
user avatar
3 votes
3 answers
603 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 ...
user avatar
6 votes
2 answers
2k 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 ...
user avatar
15 votes
5 answers
900 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....
user avatar
  • 6,361
2 votes
0 answers
150 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'...
user avatar
15 votes
3 answers
654 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 ...
user avatar
1 vote
4 answers
335 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 ...
user avatar
2 votes
2 answers
1k 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 ...
user avatar
  • 123
3 votes
0 answers
132 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(...
user avatar
  • 39