Questions tagged [decoupling]

Decoupling is the reduction of dependencies between computational parts.

Coupling is a measure of dependencies between different parts of a computer program.

Decoupling is the reduction of said dependencies, in order to improve code maintainability.

The goal of decoupling is to create a loosely coupled program (also known as "low/weak coupling".

That is because a high/tight/strong coupling program is harder to change since often a change in one part of the code forces changes to other parts of the code as well, causing a ripple effect that can spread throughout the entire code base in worst case scenarios.

The benefit of a a low/loose/weak coupling program is that when a change is needed in one part of the code, it should require no change (or at the very least, as little change as possible) to the other parts of the program - thus making the maintenance of a loosely coupled program easier.

370 questions
0
votes
1 answer

Software pattern to return concrete result from abstractions

So I'm trying to work out how (or if it's even possible) to put together a particular software architecture with some unconventional requirements. The architecture has a service layer and potentially multiple client layers that use the service…
0
votes
1 answer

How can I best decouple two classes, which one way dependencies

I am attempting to create a D&D combat encounter simulator using C++ and since it's D&D, all aspects of the simulation are going to depend heavily on the "Dice" Class and its methods. I could instantiate a "Dice" object every time another class…
0
votes
1 answer

Accessing cookies set at django backend server from the React client server

My frontend and the backend are decoupled and client runs on localhost:3000 and the backend runs at localhost:8000. I have the csrf and the refresh tokens and I set them as cookies on the server side. Now I need those cookies on the client…
otaku_weeb
  • 107
  • 10
0
votes
0 answers

Getting an error when trying to push my files to heroku "git push heroku master ERROR"

ERROR: Could not find a version that satisfies the requirement decouple==0.0.7 I am following this tutorial : https://www.youtube.com/watch?v=F5WXNI3Dq8U&t=1208s I need help narrowing down what is causing this kind of error. Would having the latest…
0
votes
0 answers

Should I store a backend SQL object ID in my Swift model?

Background I'm developing a Rails backend for my Swift app for the first time, and I'm wondering whether the I should store the record ID in my model. On the Swift side my architecture is basically MVVM and most of the business logic is contained to…
jacob_g
  • 674
  • 8
  • 21
0
votes
1 answer

How to decoupling a message from its information and implementation?

Scenario written by C# language, three principal projects in my solution: Remote, Event and Model. Remote: manages a socket from a remote system. Remote has two handlers: to notify the connection status, send the message from the remote…
lunatic84
  • 300
  • 4
  • 12
0
votes
0 answers

How can I extract only the name of the defined function from a function like macro in C?

Let's say I want to have 2 modules, which are loosely coupled. The first module is depending on the interface of the other module. I would like to decouple them by introducing defines for the interfaces. In module1_cfg.h #define FUNC1_MODULE2(x)…
0
votes
1 answer

Decoupling Monolith Without Introducing Performance Issues

I am currently trying to decouple a monolith into microservices and am running into performance issues. Currently, I have a ServiceX which requires a list of parameters to run, call them p1, p2, and p3. However, the last 2 parameters are data…
Carl390
  • 53
  • 4
0
votes
1 answer

Django can't find my environment variable? VIEW_DB_USER not found. Declare it as envvar or define a default value

I am developing an app in django and I pushed it on Heroku. I want to query my database with SQL in my views.py, so I connect to my database with connect method. When it comes to deploying my app, I obviously want to hide my database credentials. So…
Tms91
  • 3,456
  • 6
  • 40
  • 74
0
votes
1 answer

Getting decoupled modules in NestJS

I can't seem to figure out how to use dependency injection in NestJS to my liking. Here's my project structure: App --- User ------ Common \ \-- Article --/ \--- Chat In words: One big app module being the app. Feature modules user, article…
Majkeee
  • 960
  • 1
  • 8
  • 28
0
votes
2 answers

Pythonic Decoupling of Input and Resulting Object

I have various input streams that give information I want packaged into an object that I can then pass around to separate functions: class FruitBasket: def __init__(self, a, b, c, **kwargs): self.a = a self.b = b self.c…
ZSwat
  • 85
  • 6
0
votes
1 answer

Integrating python-decouple with PRAW?

I've been trying to see if I can use python-decouple to place my bot credentials on a separate .env file. Auth method is basically right off the praw doc: reddit = praw.Reddit( client_id=config('CLIENT_ID'), …
0
votes
1 answer

Class Architecture: Circular Dependency of Inner and Outer Class in Python

My Design Verbal Description I have a class Model, of course with some methods on it. Besides that I have a class ModelList whose childclass represents a List of instances of q child class of Model. Amongst other things, the use of ModelList child…
Jonathan Scholbach
  • 4,925
  • 3
  • 23
  • 44
0
votes
1 answer

Decoupling custom user data

I have a custom shader generation: class My_UniformInt { public: std::string idName; int glsl_id; //<-- userData-like field }; class My_Shader{ public: My_UniformInt textureCoordinate; public: My_Shader(){ …
javaLover
  • 6,347
  • 2
  • 22
  • 67
0
votes
2 answers

Is there a good way of decoupling similar code obtained by inheriting the same interface in c#?

Let's say, in code, we have an IEnemy interface which has a method on it called Attack(). Let's also say that we have five enemies deriving from IEnemy interface. On three of these classes, we use the exact same implementation of the Attack method.…
user8524747