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

How can i decouple my networkmanager using events?

i'm writing a program that connects with various TCP network devices. The GUI is made using JavaFX. The whole connection part is in its own package "Network". Roughly described, it looks like this: (I don't know much about UML, no blaming plaese :/…
JohnSmith
  • 33
  • 6
0
votes
0 answers

decouple software components via nameconvention

I'm currently evaluating alternatives to refactor a drivermanagement. In my multitier architecture I have Baseclass DAL.Device //my entity Interfaces BL.IDriver //handles the dataprocessing between application and device BL.IDriverCreator…
csteinmueller
  • 2,427
  • 1
  • 21
  • 32
0
votes
2 answers

Communicating input & processing errors from service layers

In my project, I have a service layer that manipulates repositories. The service layer is called by my controllers. In many cases, my controller layer is able to validate incoming information before it gets any further into the system. In some…
0
votes
1 answer

How to decouple SDL_Texture from SDL_Renderer?

I have a sprite class which uses an SDL_Texture over an SDL_Surface in lieu of perfomance. The class looks something like this: class Sprite { public: ... private: SDL_Texture *m_texture; SDL_Rect m_blitRect; …
Semirix
  • 271
  • 3
  • 13
0
votes
1 answer

Decoupling WCF Service

I understand this is a high level question (maybe even vague), but without going into detail, here it is... We are designing a wcf service to act as a translator between two large internal web apps. Each app has it's own domain classes. Our…
JChris
  • 41
  • 3
0
votes
1 answer

Coupling & Design Patterns in Web vs Desktop Applications

I'm primarily a desktop application developer but I've been doing some web design projects recently and realized that I was doing significantly more switching between files while getting significantly less work done. Problem: When developing desktop…
0
votes
1 answer

Passing a parameter through constructor

First I will present a quick outline of a somewhat tightly coupled classes (though not the worst possible case): class setUpGUI { ... JTextField output = new JTextField(); ... CountTimer ct; ... public void setOtputText(String…
PM 77-1
  • 12,933
  • 21
  • 68
  • 111
0
votes
1 answer

Decoupling the Dal Repository using the Factory pattern

I'm trying to decouple the Bll from the Dal using some interfaces and a Factory patter. Data.Contracts containing the interfaces will be referenced on my Bll. This is a small test code: class Program { static void Main(string[] args) { …
MyOwnWay
  • 741
  • 6
  • 9
0
votes
0 answers

Decoupled Message Queue Pattern for Login

Let's say a user accesses a resource and it maps to a handler foo(). In foo() I want to check if the user's session is valid. For maximum decoupling (and for the sake of the example) I put the provided session ID into a message and push that into…
0x90
  • 6,079
  • 2
  • 36
  • 55
0
votes
1 answer

Decoupling XML parser from classes

I'm writing an Android application and I want to provide the ability for the end user to create collections of objects from a class hierarchy with XML. For example: I'd like the user to be able to provide something like this arbitrary…
zero_dev
  • 613
  • 9
  • 17
0
votes
1 answer

How to Design a Decoupled HTML

Here is the situation Consider some websites has base components / controls such as header, footer, etc, and say that they share some common components as well, such as custom input, custom button, accordion panel, etc. The components can be shared…
Fendy
  • 4,565
  • 1
  • 20
  • 25
0
votes
2 answers

pass interface to itself is bad practice?

Would it be considered bad to pass an interface to itself through a method on that interface? To me this seems like it would be bad practice but if someone can help that would be great? an example ISomeInterface someInterface1 = new…
chuckd
  • 13,460
  • 29
  • 152
  • 331
0
votes
2 answers

Pass parent class to constructor of another class

I have several classes in my application, and I'd like to keep the interaction amongst classes restricted to the base classes. To make this concrete, right now I want to do something like this: class A { data public: void…
user1790399
  • 220
  • 2
  • 11
0
votes
3 answers

C++: How to get decoupled polymorphic behavior

In a Qt project in C++, I am writing an interface for dynamically loaded plugins using QtPlugin. This interface should allow plugins to register their different parameters, and while a plugin is loaded the main program should display appropriate GUI…
Toerndev
  • 715
  • 1
  • 6
  • 21
0
votes
1 answer

Refactoring and dependencies issue

I've got a number of SMS providers, each in a separate directory in the file system. The main class inside each provider directory extends abstract class ProviderAbstract.php which is located elsewhere in the filesystem and outside the provider…
zoro74
  • 171
  • 15