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

Yii2 module independency

We're developing an Yii2 php appliction, which can be seen as a AirBNB clone for sake of simplicity. I'm trying to devide the application into modules, but keep getting ugly dependencies no matter how I twist or try. Couple of examples: There is a…
user3136936
  • 311
  • 3
  • 11
0
votes
1 answer

How to refactor jqGrid code, from controller's JsonResult method, to loosely coupled models?

I'm using an example from Code Project: ASP.NET MVC-4,Entity Framework and JQGrid Demo with simple Todo List WebApplication. However, the developer didn't maximize cohesion since the the controller is doing all the business logic. I'm trying to…
0
votes
1 answer

With an onion architecture should all lower layer objects be used through an interface?

I'm somewhat new to the onion architecture. I created a service layer that calls repositories in the DAL by manually passing them into the constructor. But now looking at my method I'm using an object from the core domain and I'm wondering if I…
chuckd
  • 13,460
  • 29
  • 152
  • 331
0
votes
1 answer

Decoupling client code from library

We have a image utility method tightly coupled to the Sanselan library, and now I need to add a second library (Metadata Extractor) to try and read the image's metainfo in case Sanselan can't do it. I say that our code is tightly coupled to Sanselan…
user3748908
  • 885
  • 2
  • 9
  • 26
0
votes
1 answer

Decouple data from code

Let's say I have a table called Couriers in my database and an Entity Framework class also called Couriers (DbContext.Couriers), with this example data: Id: 1. Name: UPS Id: 2. Name: DHL I have extended this class with two subclasess CourierUPS and…
Carlos
  • 1,638
  • 5
  • 21
  • 39
0
votes
1 answer

Why is the DataGrid column binding not breaking MVVM structure?

I am not experienced with WPF/MVVM, this is probably not a well founded question. In the basic MVVM structure of a WPF MVVM Form, I believe I am right in saying that it can take a form similar to that which I have included in the footer of this…
David Moores
  • 1,025
  • 2
  • 9
  • 23
0
votes
1 answer

How can i decouple my model's data source from PHP ActiveRecord?

The situation: All our app's models are coupled to the ActiveRecord framework, and inherit from ActiveRecord\Model. The problem is that we are moving some of our data to a REST service and thus a handful of our models will no longer be accessing the…
erstaples
  • 1,986
  • 16
  • 31
0
votes
0 answers

Designing scripting in a game without too much coupling

I am making a 3D game in C++ using OGRE, and I'd like to implement scripting. So I have a subproject engine which directly "talk" with OGRE, and an another subproject v8-scripting which provides a V8Interface class which has a function init for the…
Vinz243
  • 9,654
  • 10
  • 42
  • 86
0
votes
1 answer

Modular Java Application

I am trying to separate my projects into two different jars. First one will be the 'core' jar which will have all business logic. Second one is for command prompt version which will use core. Following is the project structure with content and code…
αƞjiβ
  • 3,056
  • 14
  • 58
  • 95
0
votes
1 answer

Using makefiles to identify and reduce coupling

For a large project that can benefit from some refactoring one of my goals is to reduce coupling. I'm looking at coupling here as the ability to break up the code into very small/logical compile units much like how coupling is explained in This…
Aage Torleif
  • 1,907
  • 1
  • 20
  • 37
0
votes
0 answers

De-coupling Physics/Data-Changing Components from Render-System

I'm currently reading "Game Programming Patterns by Robert Nystrom". The book explains why you should "un-couple" the different components of a piece of software, in my case a game. Unfortunately, I already started hacking together a little game,…
Fly
  • 810
  • 2
  • 9
  • 28
0
votes
1 answer

Multiple client views/UIs with Jhipster

We are planning to have multiple client views/UIs (E.g. Customer facing UI and Internal UI) on one (same) set of web services which perform end-to-end operation needed for both views/UIs including login. I am assuming this is possible with minor…
Sudheer
  • 479
  • 1
  • 4
  • 9
0
votes
2 answers

Decoupling EF6 from its custom Api

I would like to ask some help regarding Dependency Injection and, I think, architectural approach. So, I have an ORM layer implemented by EF6 where the objects are described and Ef does what its business, etc. I created a custom library over it,…
AndrasCsanyi
  • 3,943
  • 8
  • 45
  • 77
0
votes
1 answer

How to drop dependency on class method

I have the 3 following classes: Base module TitleSource class Base include Comparable attr_accessor :company attr_accessor :priority attr_accessor :target_title def initialize(args={}) self.company = args[:company] …
Francesco Belladonna
  • 11,361
  • 12
  • 77
  • 147
0
votes
0 answers

Putting mechanism in-between multiple implementations of the abstract class

I am working in .NET 4.5 WPF application I have 3 views that are using containers with questions. 2 views have one set of questions and I am now working on adding another one that has 2 containers of questions as it is for two customers at once.…
Matas Vaitkevicius
  • 58,075
  • 31
  • 238
  • 265