Questions tagged [loose-coupling]
207 questions
0
votes
1 answer
When should we prefer hard coupling over loose coupling?
With all the hype about loose coupling (with reason) and all the information ive read its easy to get all obsessed, to the point of becoming religious about it. Ive been wondering, when is hard coupling favorible over loose coupling? When is an…

Asperger
- 3,064
- 8
- 52
- 100
0
votes
2 answers
When should I create factory or VM in angular
This is how my angular app looks like.
(function () {
"use strict";
angular
.module("app")
.controller("custCtrl", custCtrl);
custCtrl.$inject = ['dataService','custFactory'];
/* @ngInject */
function custCtrl(dataService, custFactory) {
…

Kgn-web
- 7,047
- 24
- 95
- 161
0
votes
0 answers
can loose coupling be achieved in spring just by using annotations - avoiding xml
I have gone through a example from https://www.mkyong.com/spring/spring-loosely-coupled-example/ .
The example below uses beans to achieve loose coupling.
How can we achieve the same loose coupling using annotations instead of beans?
package…

Chinta Sai Vamshi
- 319
- 3
- 11
0
votes
0 answers
How to implement a Java light weight dependency analizer that generates a simple text raw listing?
The output should show something simple like this (or anything else that could be still simple):
A depends on B, C and D
B depends on E and F
F depends on A (warning: coupling problem!)
The coupling detection warn isnt even necessary…

Aquarius Power
- 3,729
- 5
- 32
- 67
0
votes
1 answer
how to achieve true loose coupling using Prism and Unity
I have developed a WPF application using Prism and Unity frameworks and I have some concerns regarding the following whether I have implemented them correctly or not.
Abstract classes / Interfaces - I have organized interfaces for all the layers in…

Kassim Shaikh
- 63
- 4
0
votes
1 answer
how to register parameterized based constructor classes in unity container in C#?
I am new to Dependency injection Pattern. Please look in to the below scenario. Right now, my below code is in tightly coupled. I want to make this as lightly coupled.
Could someone help me out to implement dependency injection using Unity?
//…

user1664906
- 1
- 5
0
votes
1 answer
Louse coupling and java buttons
I am reading a book and it gives an example on loose coupling:
As an example take Javas buttons, where you take and assign a button
listener to the buttons of the existing type without having to change
anything in the existing button class.
I…

Lebowski
- 145
- 1
- 12
0
votes
1 answer
How to setup "Loosely Coupled" design pattern in "Laravel"
I am very new to “Laravel” world so I could be wrong in very basics.
I am trying to setup a project with “Loosely Coupled” design pattern. I have looked into following…

user2517610
- 275
- 2
- 8
- 27
0
votes
2 answers
Handling Object Dependency
Consider the following class
class User
{
protected $password;
public function setPassword($password)
{
$this->password = $password;
return $this;
}
public function getPassword()
{
return…

Ibrahim Azhar Armar
- 25,288
- 35
- 131
- 207
0
votes
3 answers
Dependency Injection: Difference between loose coupling mechanisms based on interface and class?
Suppose, I have 2 configurations.
First one:
interface I {
...
}
class A implements I {
...
}
class B implements I {
...
}
class Component {
I i;
Component (I i) {
this.i = i;
}
}
Second one:
class C {
…

Finkelson
- 2,921
- 4
- 31
- 49
0
votes
1 answer
c++ loose coupling function dependency
As the title already might suggest I am having a hard time describing my architectural problem and for the same reason searching has been without result. I am writing a command line application which aims to take in two-dimensional data to which a…

Pankrates
- 3,074
- 1
- 22
- 28
0
votes
1 answer
ls loose coupling can be achieved by any other manner rather than using parent class reference variable, in general not specifically in mine code?
Tight coupling is when a group of classes are highly dependent on one another.
class C {
A a;
C(B b) {
a = b;
}
}
Interface A {
}
class B implements A {
}
In my code I am accepting object of class through reference of class B…
user4768611
0
votes
2 answers
dynamically populate properties of a class
I have the following code which takes some values from my App.config and tries to use them to populate the properties of a class.
foreach (string ReferenceKey in Utilities.CSVToList(ConfigurationManager.AppSettings[source + ":Keys"]))
{
if…

stumped221
- 89
- 4
- 18
0
votes
1 answer
Java: How can an 'agent' object that is inside a 'world' object obtain information about the 'world'?
Sorry for the slightly demented wording of this question, but I'm very new to agent-oriented thinking (are these 'patterns'?) and only slightly less new to java, and I'm struggling with what feels like a very basic problem.
I'm doing a lot of this…

Toadfish
- 1,112
- 1
- 12
- 22
0
votes
0 answers
Loose coupling when using auto generated domain model from external source
I've run into a rather annoying issue when dealing with auto generated classes that's part of the domain model.
For example I'm consuming an OData endpoint which has entities that's part of my core domain model. I'm using the OData v4 Client Code…

Snæbjørn
- 10,322
- 14
- 65
- 124